Part Number Hot Search : 
000950 MD1332F DM74A MC3448A IDT72 1A221M 19500230 BA3402
Product Description
Full Text Search
 

To Download CP2400 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 CP2400/1/2/3
128/64 SEGMENT L C D DRIVER
LCD Driver
up to 128 segments (48-pin packages) or 64 segments (32-pin package) Supports static, 2-mux, 3-mux, and 4-mux displays On-chip bias generation with internal charge pump Low power blink capability
Controls
Digital Bus Interface
4-wire
SPI Interface operates up to 2.5 Mbps with synchronous external clock or up to 1 Mbps with internal clock (CP2400/2 only).
GPIO Expander
GPIO count by up to 36 pins (48-pin packages) or 20 pins (32-pin package) GPIO pins may be configured to push-pull or open-drain outputs with two drive levels. GPIO may also be used as digital inputs (CP2400/1/2/3 pullups included) Port Match Capability can wake up host controller using interrupt pin 5 V Tolerant I/O
Expands
SMBus/I2C Interface operates up to 400 kHz with internal clock (CP2401/3 only). Dedicated RST and INT pins. Optional CLK pin can be used as a CMOS clock input.
2-wire Optional
PWR pin (SMBus/I2C devices only) places the device in a low power mode. SPI devices use the NSS pin to place the device in a low power mode.
Low Power
V operation with integrated LDO Low Power Mode w/ LCD (<3 A typical) Shutdown current (0.05 A typical)
1.8-3.6 Ultra
Real Time Clock, SmaRTClock
time keeping with 32.768 kHz watch crystal; self-oscillate mode requires no external crystal; accepts external 32 kHz CMOS clock 36-hour programmable counter with wake up alarm Can wake up the host controller using interrupt pin Low power (<1.5 A)
Precision
Example Applications
Equipment Meters Thermostat Display Home Security Systems
Handheld Utility
Packages
48-pin QFP (9x9 mm footprint) [-Q] 48-pin QFN (7x7 mm footprint) [-M] Pb-free 32-pin QFN (5x5 mm footprint)
Pb-free Pb-free
256 Bytes RAM
General
purpose RAM expands the memory available to host controller. general purpose 16-bit timers
16-bit Timers
Two
Ordering Part Numbers
CP2400-G[M|Q] CP2401-G[M|Q]
(SPI Interface)
Clock Sources
20 Can
MHz Internal oscillator be clocked from an external CMOS clock
(SMBus/I2C Interface) CP2402-GM (SPI Interface)
CP2403-GM
(SMBus/I2C Interface)
Temperature Range: -40 to +85 C
CP2400/1/2/3 20 MHz Internal Oscillator Optional 32.768 kHz
Host Interface SPI (CP2400/2) OR SMBus/I2C (CP2401/3)
smaRTClock
Host Controller
2 x 16-bit Timers
GPIO Expander
Digital I/O
256 Byte SRAM
LCD Controller
LCD
Rev. 1.0 8/10
Copyright (c) 2010 by Silicon Laboratories
CP2400/1/2/3
CP2400/1/2/3
2
Rev. 1.0
CP2400/1/2/3
1. System Overview .................................................................................................................5 1.1. Typical Connection Diagram ..........................................................................................9 2. Absolute Maximum Ratings.............................................................................................. 11 3. Electrical Characteristics .................................................................................................. 12 4. Pinout and Package Definitions ....................................................................................... 17 5. Clocking Options ...............................................................................................................32 6. Internal Registers and Memory ........................................................................................ 34 6.1. Accessing Internal Registers and RAM over the SPI Interface .................................... 35 6.2. Accessing Internal Registers and RAM over the SMBus Interface .............................. 36 6.3. Internal Registers .........................................................................................................37 7. Interrupt Sources ...............................................................................................................40 8. Reset Sources .................................................................................................................... 47 8.1. Reset Initialization ........................................................................................................47 8.2. Power-On Reset........................................................................................................... 48 8.3. External Pin Reset........................................................................................................48 9. Power Modes......................................................................................................................49 9.1. Normal Mode................................................................................................................ 50 9.2. RAM Preservation Mode .............................................................................................. 50 9.3. Ultra Low Power LCD Mode......................................................................................... 51 9.4. Ultra Low Power SmaRTClock Mode........................................................................... 52 9.5. Shutdown Mode ........................................................................................................... 53 9.6. Determining the ULP Mode Wake-Up Source..............................................................55 9.7. Port Match Functionality in the Ultra Low Power Modes.............................................. 56 9.8. Disabling Secondary Device Functions........................................................................ 58 10. Port Input/Output ...............................................................................................................60 10.1.Port I/O Modes of Operation ........................................................................................ 61 10.2.Assigning Port I/O Pins to Analog and Digital Functions ............................................. 62 10.3.Active Mode Port Match............................................................................................... 63 10.4.Registers for Accessing and Configuring Port I/O .......................................................65 11. SmaRTClock (Real Time Clock)........................................................................................ 69 11.1.SmaRTClock Interface.................................................................................................70 11.2.SmaRTClock Clocking Sources...................................................................................74 11.3.SmaRTClock Timer and Alarm Function .....................................................................77 12. LCD Segment Driver ..........................................................................................................83 12.1.Initializing the LCD Segment Driver ............................................................................. 83 12.2.LCD Configuration ....................................................................................................... 84 12.3.LCD Bias Generation and Contrast Adjustment .......................................................... 85 12.4.LCD Timing Generation ............................................................................................... 87 12.5.Mapping ULP Memory to LCD Pins ............................................................................. 90 12.6.Blinking LCD Segments ............................................................................................... 91 13. Timers ................................................................................................................................. 92 13.1.Timer 0 ....................................................................................................................... 92 13.2.Timer 1 ....................................................................................................................... 96 14. Serial Peripheral Interface (SPI) ..................................................................................... 101 14.1.Signal Descriptions .................................................................................................... 101 14.2.Serial Clock Timing .................................................................................................... 102
Rev. 1.0
3
CP2400/1/2/3
15. SMBus Interface............................................................................................................... 104 15.1.Supporting Documents .............................................................................................. 104 15.2.SMBus Configuration ................................................................................................. 104 15.3.SMBus Operation....................................................................................................... 105 Document Change List ........................................................................................................ 108 Contact Information .............................................................................................................110
4
Rev. 1.0
CP2400/1/2/3
1. System Overview
CP2400/1/2/3 devices are fixed function LCD drivers that can also be used for expanding GPIO, timekeeping, and increasing available system RAM by up to 256 bytes. The device is controlled using direct and indirect internal registers accessible through the 4-wire SPI or 2-wire SMBus interface. All digital pins on the device are 5 V tolerant.
Power On Reset RST VDD GND Power Management
Power Net Analog Power Reset
Port I/O Configuration P0.0/LCD0 P0.1/LCD1 P0.2/LCD2 P0.3/LCD3 P0.4/LCD4 P0.5/LCD5 P0.6/LCD6 P0.7/LCD7 P1.0/LCD8 P1.1/LCD9 P1.2/LCD10 P1.3/LCD11 P1.4/LCD12 P1.5/LCD13 P1.6/LCD14 P1.7/LCD15 P2.0/LCD16 P2.1/LCD17 P2.2/LCD18 P2.3/LCD19 P2.4/LCD20 P2.5/LCD21 P2.6/LCD22 P2.7/LCD23 P3.0/LCD24 P3.1/LCD25 P3.2/LCD26 P3.3/LCD27 P3.4/LCD28 P3.5/LCD29 P3.6/LCD30 P3.7/LCD31 P4.0/COM0 P4.1/COM1 P4.2/COM2 P4.3/COM3 CAP
GPIO Expander
Digital Power
VREG
Port 0 Drivers
2 x Timer (16-bit)
256 Byte SRAM
SCK MISO MOSI NSS INT
Port 1 Drivers
SPI (4-wire)
SFR Bus
Port 2 Drivers
Host Interface
Low Power 20 MHz Oscillator CLK External CMOS Clock
SmaRTClock Oscillator
SYSCLK
LCD Control
Charge Pump
Port 3 Drivers
XTAL1 XTAL2
MUX Decode Logic Port 4 Drivers Segment RAM
System Clock Configuration
Figure 1.1. CP2400 Block Diagram
Rev. 1.0
5
CP2400/1/2/3
Power On Reset RST VDD GND PWR Power Management
Power Net Analog Power Reset
Port I/O Configuration P0.0/LCD0 P0.1/LCD1 P0.2/LCD2 P0.3/LCD3 P0.4/LCD4 P0.5/LCD5 P0.6/LCD6 P0.7/LCD7 P1.0/LCD8 P1.1/LCD9 P1.2/LCD10 P1.3/LCD11 P1.4/LCD12 P1.5/LCD13 P1.6/LCD14 P1.7/LCD15 P2.0/LCD16 P2.1/LCD17 P2.2/LCD18 P2.3/LCD19 P2.4/LCD20 P2.5/LCD21 P2.6/LCD22 P2.7/LCD23 P3.0/LCD24 P3.1/LCD25 P3.2/LCD26 P3.3/LCD27 P3.4/LCD28 P3.5/LCD29 P3.6/LCD30 P3.7/LCD31 P4.0/COM0 P4.1/COM1 P4.2/COM2 P4.3/COM3 CAP
GPIO Expander
Digital Power
VREG
Port 0 Drivers
2 x Timer (16-bit)
256 Byte SRAM
SMBA0 SDA SCL INT
Port 1 Drivers
SMBus/I2C (2-wire)
SFR Bus
Port 2 Drivers
Host Interface
Low Power 20 MHz Oscillator CLK External CMOS Clock
SmaRTClock Oscillator
SYSCLK
LCD Control
Charge Pump
Port 3 Drivers
XTAL1 XTAL2
MUX Decode Logic Port 4 Drivers Segment RAM
System Clock Configuration
Figure 1.2. CP2401 Block Diagram
6
Rev. 1.0
CP2400/1/2/3
Power On Reset RST VDD GND Power Management
Power Net Analog Power Reset
Port I/O Configuration P0.0/LCD0 P0.1/LCD1 P0.2/LCD2 P0.3/LCD3 P0.4/LCD4 P0.5/LCD5 P0.6/LCD6 P0.7/LCD7 P1.0/LCD8 P1.1/LCD9 P1.2/LCD10 P1.3/LCD11 P1.4/LCD12 P1.5/LCD13 P1.6/LCD14 P1.7/LCD15
GPIO Expander
Digital Power
VREG
Port 0 Drivers
2 x Timer (16-bit)
256 Byte SRAM
SCK MISO MOSI NSS INT
Port 1 Drivers
SPI (4-wire)
SFR Bus
Host Interface
Low Power 20 MHz Oscillator CLK External CMOS Clock
SmaRTClock Oscillator
SYSCLK
LCD Control
Charge Pump
XTAL1 XTAL2
MUX Decode Logic Port 2 Drivers Segment RAM
System Clock Configuration
P2.0/COM0 P2.1/COM1 P2.2/COM2 P2.3/COM3 CAP
Figure 1.3. CP2402 Block Diagram
Rev. 1.0
7
CP2400/1/2/3
Power On Reset RST VDD GND PWR Power Management
Power Net Analog Power Reset
Port I/O Configuration P0.0/LCD0 P0.1/LCD1 P0.2/LCD2 P0.3/LCD3 P0.4/LCD4 P0.5/LCD5 P0.6/LCD6 P0.7/LCD7 P1.0/LCD8 P1.1/LCD9 P1.2/LCD10 P1.3/LCD11 P1.4/LCD12 P1.5/LCD13 P1.6/LCD14 P1.7/LCD15
GPIO Expander
Digital Power
VREG
Port 0 Drivers
2 x Timer (16-bit)
256 Byte SRAM
SMBA0 SMBA1 SDA SCL INT
Port 1 Drivers
SMBus/I2C (2-wire)
SFR Bus
Host Interface
Low Power 20 MHz Oscillator CLK External CMOS Clock
SmaRTClock Oscillator
SYSCLK
LCD Control
Charge Pump
XTAL1 XTAL2
MUX Decode Logic Port 2 Drivers Segment RAM
System Clock Configuration
P2.0/COM0 P2.1/COM1 P2.2/COM2 P2.3/COM3 CAP
Figure 1.4. CP2403 Block Diagram
8
Rev. 1.0
CP2400/1/2/3
1.1. Typical Connection Diagram
VDD 0.1 uF VDD CAP 10 uF
XTAL1 32.768 kHz XTAL2
LCD
LCD0 Segment Pin 1
LCDn
Segment Pin (n+1)
MCU
SCK MISO MOSI NSS GPIO GPIO GPIO SCK MISO MOSI NSS INT
CP240x
COM0 COM1 COM2 COM3 COM1 COM2 COM3 COM4
Px.x RST CLK Px.y
GPIO, Analog, etc.
GND
GND
Figure 1.5. Typical Connection Diagram (SPI Interface)
Rev. 1.0
9
CP2400/1/2/3
VDD 0.1 uF VDD CAP 10 uF
32.768 kHz
XTAL1 XTAL2
LCD
LCD0 Segment Pin 1
VDD LCDn Segment Pin (n+1)
MCU
SCL SDA
SMBA0 SCL SDA
CP240x
COM0 COM1 COM2 COM3 COM1 COM2 COM3 COM4
GPIO
INT
GPIO GPIO GPIO
PWR RST CLK
Px.x
GPIO, Analog, etc.
Px.y
GND
GND
Figure 1.6. Typical Connection Diagram (SMBus/I2C Interface)
10
Rev. 1.0
CP2400/1/2/3
2. Absolute Maximum Ratings
Table 2.1. Absolute Maximum Ratings
Parameter Ambient temperature under bias Storage Temperature Voltage on any I/O Pin or RST with respect to GND Voltage on VDD with respect to GND Maximum Total current through VDD and GND Maximum output current sunk by RST or any I/O pin VDD > 2.2 V VDD < 2.2 V Conditions Min -55 -65 -0.3 -0.3 -- -- Typ -- -- -- -- -- -- Max 125 150 5.8 VDD + 3.6 4.2 500 100 Units C C V V mA mA
Note: Stresses above those listed may cause permanent damage to the device. This is a stress rating only, and functional operation of the devices at or exceeding the conditions in the operation listings of this specification is not implied. Exposure to maximum rating conditions for extended periods may affect device reliability.
Rev. 1.0
11
CP2400/1/2/3
3. Electrical Characteristics
Table 3.1. Global Electrical Characteristics
VDD = 1.8 to 3.6 V, -40 to +85 C unless otherwise specified.
Parameter Supply Voltage SYSCLK TSYSH (SYSCLK High Time) TSYSL (SYSCLK Low Time) Specified Operating Temperature Range 20 MHz Internal Oscillator divided by 1, SYSCLK = 20 MHz, SPI data rate = 1 Mbps* Accessing RAM at 1 Mbps SYSCLK = 10 MHz, SPI data rate* = rate* = 500 kbps SYSCLK = 5 MHz, SPI data rate* = 250 kbps SYSCLK = 2.5 MHz, SPI data 125 kbps
Conditions
Min 1.8 0 18 18 -40
Typ 3.3 -- -- -- -- 740 700 630 740 380 230 150
Max 3.6 25 -- -- +85 790 -- -- -- -- -- --
Units V MHz ns ns C A
Normal Mode Supply Current (VDD = 3.0 V, 25 C unless otherwise specified) VDD = 3.6 V VDD = 3.0 V VDD = 1.8 V -- -- -- -- -- -- --
A A A A A
RAM Preservation Mode Supply Current (VDD = 3.0 V, 25 C unless otherwise specified) 32.768 kHz SmaRTClock Selected as the -- 20 -- System Clock, Internal Oscillator Disabled Ultra Low Power LCD Mode Supply Current (VDD = 3.0 V, 25 C unless otherwise specified) LCD Enabled with Charge Pump Enabled, 60 Hz Refresh Rate, No Load SmaRTClock with 32.768 kHz crystal LCD Enabled with Charge Pump Enabled, 60 Hz Refresh Rate, No Load SmaRTClock in Self-Oscillate Mode (AGC Enabled, LOADCAP = 0x0F) 4-Mux mode 3-Mux mode 2-Mux mode static mode 4-Mux mode 3-Mux mode 2-Mux mode static mode Fosc = 32.768 kHz Fosc = 32.768 kHz -- -- -- -- -- -- -- -- -- -- -- 2.3 2.3 2.2 2.1 1.7 1.7 1.7 1.5 2.5 2.3 2.0 -- -- -- -- -- -- -- -- -- -- --
A
A
Ultra Low Power SmaRTClock Mode Supply Current (VDD = 3.0 V, 25 C unless otherwise specified) External Crystal (RTC Timer Enabled) CMOS Clock Input on XTAL1 and XTAL2 Pins (RTC Timer Enabled) A A A
Self-Oscillate Mode (AGC enabled, Fosc = 14 kHz LOADCAP = 0x0F) (RTC Timer Enabled) Shutdown Mode (VDD = 3.0 V, 25 C unless otherwise specified) Shutdown (no clocks active, regulator disabled) VDD = 3.6 V VDD = 3.0 V VDD = 1.8 V
-- -- --
0.030 0.020 0.015
-- -- --
A
*Note: Indicates maximum allowed SPI data rate in this mode. Power measurement taken with no SPI traffic.
12
Rev. 1.0
CP2400/1/2/3
Table 3.2. Port I/O DC Electrical Characteristics
VDD = 1.8 to 3.6 V, -40 to +85 C unless otherwise specified.
Parameters Output High Voltage
Conditions High Drive Strength, PnDRV.n = 1 IOH = -3 mA, Port I/O push-pull IOH = -10 A, Port I/O push-pull IOH = -10 mA, Port I/O push-pull Low Drive Strength, PnDRV.n = 0 IOH = -1 mA, Port I/O push-pull IOH = -10 A, Port I/O push-pull IOH = -3 mA, Port I/O push-pull
Min VDD - 0.7 VDD - 0.1 --
Typ
Max
Units
-- -- See Chart
-- -- -- V
VDD - 0.7 VDD - 0.1 --
-- -- See Chart
-- -- --
Output Low Voltage
High Drive Strength, PnDRV.n = 1 IOL = 8.5 mA IOL = 10 A IOL = 15 mA Low Drive Strength, PnDRV.n = 0 IOL = 1.4 mA IOL = 10 A IOL = 4 mA -- -- -- VDD - 0.6 0.7 x VDD -- -- -- -- -- -- See Chart -- -- -- -- 4 20 0.6 0.1 -- -- -- 0.6 0.3 x VDD -- 30 V V V V A -- -- -- -- -- See Chart 0.6 0.1 -- V
Input High Voltage Input Low Voltage
VDD = 2.0 to 3.6 V VDD = 1.8 to 2.0 V VDD = 2.0 to 3.6 V VDD = 1.8 to 2.0 V Weak Pullup On, VIN = 0 V, VDD = 1.8 V Weak Pullup On, Vin = 0 V, VDD = 3.6 V
Input Leakage Current
Rev. 1.0
13
CP2400/1/2/3
Typical VOH (High Drive Mode) 3.6 3.3 3 2.7 Voltage 2.4 2.1 1.8 1.5 1.2 0.9 0 5 10 15 20 25 30 35 40 45 50 Load Current (mA)
Typ ic a l V O H (L o w D rive M o d e ) 3 .6 3 .3 3 2 .7 Voltage 2 .4 2 .1 1 .8 1 .5 1 .2 0 .9 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 L o a d C urre nt (m A ) V D D = 3 .6 V V D D = 3 .0 V V D D = 2 .4 V V D D = 1 .8 V
VDD = 3.6V VDD = 3.0V VDD = 2.4V VDD = 1.8V
Figure 3.1. Typical VOH
14
Rev. 1.0
CP2400/1/2/3
Typical VOL (High Drive Mode) 1.8 VDD = 3.6V 1.5 VDD = 3.0V 1.2 Voltage VDD = 2.4V VDD = 1.8V
0.9
0.6
0.3
0 -80 -70 -60 -50 -40 -30 -20 -10 0 10 Load Current (mA)
Typical VOL (Low Drive Mode) 1.8 VDD = 3.6V 1.5 VDD = 3.0V 1.2 Voltage VDD = 2.4V VDD = 1.8V
0.9
0.6
0.3
0 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 Load Current (mA)
Figure 3.2. Typical VOL
Rev. 1.0
15
CP2400/1/2/3
Table 3.3. Reset Electrical Characteristics
VDD = 1.8 to 3.6 V, -40 to +85 C unless otherwise specified.
Parameters RST Input High Voltage RST Input Low Voltage RST Input Pullup Current VDD Ramp Time for Power On1 Power on Reset Delay (TPORDelay) from Start of Ramp until the Reset Complete Interrupt Required RST Low Time to guarantee a System Reset (TRST) Startup Delay from Reset Deasserted until the Reset Complete Interrupt (TSTARTUP)
Conditions
Min 0.7 x VDD --
Typ -- -- 4 20 -- 1200 660 575 -- 90
Max -- 0.3 x VDD -- 30 1 -- 900 -- -- 100
UNITS V V A ms s
RST = 0 V, VDD = 1.8 V RST = 0 V, VDD = 3.6 V VDD Ramp from 0-1.8 V VDD = 1.8 V VDD = 3.0 V VDD = 3.6 V See Note 2 Pin Reset
-- -- -- -- -- -- 15 --
s s
Notes: 1. There is no restriction on VDD ramp time if the RST pin is toggled at the end of the ramp. 2. If the RST pin is held low for a shorter time period, a device reset may occur.
Table 3.4. Power Management Electrical Specifications
VDD = 1.8 to 3.6 V, -40 to +85 C unless otherwise specified.
Parameter
Conditions
Min
Typ 10
Max
Units ns
RAM Preservation Mode Wake-Up From the falling edge of CLK until Time host interface ready ULP Mode Wake-Up Time (from the falling edge of NSS/PWR to the reset complete interrupt) Port Match or SmaRTClock Wakeup NSS/PWR Pin Wakeup 3 7
-- --
4 8
RTC Cycles
Table 3.5. Internal Oscillator Electrical Characteristics
VDD = 1.8 to 3.6 V; TA = -40 to +85 C unless otherwise specified; Using factory-calibrated settings.
Parameter Oscillator Frequency Oscillator Supply Current (from VDD)
Conditions -40 to +85 C, VDD = 1.8-3.6 V 25 C
Min 15 --
Typ 20 50
Max 25 --
Units MHz A
Table 3.6. LCD Electrical Characteristics
VDD = 1.8 to 3.6 V; TA = -40 to +85 C unless otherwise specified.
Parameter Charge Pump Output Voltage Error
Conditions
Min --
Typ 30
Max --
Units mV
16
Rev. 1.0
CP2400/1/2/3
4. Pinout and Package Definitions
Table 1. CP2400/1/2/3 Pin Definitions
Name Pin Numbers 48-pin SPI XTAL1 XTAL2 VDD GND CAP CLK RST 1 2 3 4 48 47 46 I 2C 1 2 3 4 48 47 46 32-pin SPI 1 2 3 4 32 31 30 I 2C 1 2 3 4 32 31 30 Power Out D In D In A In A Out Crystal Input. This pin is the return for the external oscillator driver. This pin can be overdriven by an external CMOS clock. Crystal Output. This pin is the excitation driver for a quartz crystal. Type Description
Power In 1.8-3.6 V Power Supply Voltage Input. Ground LCD Power Supply Voltage Output. This pin requires a 10 F decoupling capacitor. CMOS clock input. This pin should not be left floating. Device Reset. An external source can initiate a system reset by driving this pin low for at least 15 s. This pin has an internal weak pullup. Interrupt Service Request. This pin provides notification to the host. This pin is a push-pull output. Slave select signal for SPI interface. This pin should not be left floating. Master Out/Slave In data signal for SPI interface. This pin should not be left floating. Master In/Slave Out data signal for SPI interface Clock signal for SPI interface. This pin should not be left floating. Allows SMBus device to enter the Ultra Low Power mode. This pin should not be left floating. Clock signal for SMBus interface. This pin should not be left floating. Data signal for SMBus interface. This pin should not be left floating. Bit 0, SMBus Slave Address. This pin should not be left floating. Bit 0, Port 0 Bit 1, Port 0
INT NSS MOSI MISO SCK PWR SCL SDA SMBA0 P0.0 LCD0 P0.1 LCD1
45 44 43 42 41 -- -- -- -- 40 39
45 -- -- -- -- 44 43 42 41 40 39
29 28 27 26 25 -- -- -- -- 24 23
29 -- -- -- -- 28 27 26 25 24 23
D Out D In D In D Out D In D In D I/O D I/O D In D I/O A Out D I/O A Out
Rev. 1.0
17
CP2400/1/2/3
Table 1. CP2400/1/2/3 Pin Definitions (Continued)
Name Pin Numbers 48-pin SPI P0.2 LCD2 P0.3 LCD3 P0.4 LCD4 P0.5 LCD5 P0.6 LCD6 P0.7 LCD7 P1.0 LCD8 P1.1 LCD9 P1.2 LCD10 P1.3 LCD11 P1.4 LCD12 P1.5 LCD13 P1.6 LCD14 P1.7 LCD15 P2.0 LCD16 P2.1 LCD17 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 I 2C 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 32-pin SPI 22 21 20 19 18 17 16 15 14 13 12 11 10 9 -- -- I 2C 22 21 20 19 18 17 16 15 14 13 12 11 10 9 -- -- D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out Bit 2, Port 0 Bit 3, Port 0 Bit 4, Port 0 Bit 5, Port 0 Bit 6, Port 0 Bit 7, Port 0 Bit 0, Port 1 Bit 1, Port 1 Bit 2, Port 1 Bit 3, Port 1 Bit 4, Port 1 Bit 5, Port 1 Bit 6, Port 1 Bit 7, Port 1 Bit 0, Port 2 Bit 1, Port 2 Type Description
18
Rev. 1.0
CP2400/1/2/3
Table 1. CP2400/1/2/3 Pin Definitions (Continued)
Name Pin Numbers 48-pin SPI P2.2 LCD18 P2.3 LCD19 P2.0 COM0 P2.1 COM1 P2.2 COM2 P2.3 COM3 P2.4 LCD20 P2.5 LCD21 P2.6 LCD22 P2.7 LCD23 P3.0 LCD24 P3.1 LCD25 P3.2 LCD26 P3.3 LCD27 P3.4 LCD28 P3.5 LCD29 22 21 -- -- -- -- 20 19 18 17 16 15 14 13 12 11 I 2C 22 21 -- -- -- -- 20 19 18 17 16 15 14 13 12 11 32-pin SPI -- -- 8 7 6 5 -- -- -- -- -- -- -- -- -- -- I 2C -- -- 8 7 6 5 -- -- -- -- -- -- -- -- -- -- D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out Bit 2, Port 2 Bit 3, Port 2 Bit 0, Port 2 Bit 1, Port 2 Bit 2, Port 2 Bit 3, Port 2 Bit 4, Port 2 Bit 5, Port 2 Bit 6, Port 2 Bit 7, Port 2 Bit 0, Port 3 Bit 1, Port 3 Bit 2, Port 3 Bit 3, Port 3 Bit 4, Port 3 Bit 5, Port 3 Type Description
Rev. 1.0
19
CP2400/1/2/3
Table 1. CP2400/1/2/3 Pin Definitions (Continued)
Name Pin Numbers 48-pin SPI P3.6 LCD30 P3.7 LCD31 P4.0 COM0 P4.1 COM1 P4.2 COM2 P4.3 COM3 10 9 8 7 6 5 I 2C 10 9 8 7 6 5 32-pin SPI -- -- -- -- -- -- I 2C -- -- -- -- -- -- D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out D I/O A Out Bit 6, Port 3 Bit 7, Port 3 Bit 0, Port 4 Bit 1, Port 4 Bit 2, Port 4 Bit 3, Port 4 Type Description
20
Rev. 1.0
CP2400/1/2/3
P0.0/LCD0 P0.1/LCD1 P0.2/LCD2
38
48
47
46
45
44
43
42
41
40
39
XTAL1 XTAL2 VDD GND P4.3/COM3 P4.2/COM2 P4.1/COM1 P4.0/COM0 P3.7/LCD31 P3.6/LCD30 P3.5/LCD29 P3.4/LCD28
37
P0.3/LCD3
MISO
MOSI
CAP
NSS
SCK
RST
CLK
INT
1 2 3 4 5 6 7 8 9 10 11 12
36 35 34 33 32
P0.4/LCD4 P0.5/LCD5 P0.6/LCD6 P0.7/LCD7 P1.0/LCD8 P1.1/LCD9 P1.2/LCD10 P1.3/LCD11 P1.4/LCD12 P1.5/LCD13 P1.6/LCD14 P1.7/LCD15
CP2400 - GQ Top View
31 30 29 28 27 26 25
13
14
15
16
17
18
19
20
21
22
23
P3.3/LCD27
P3.2/LCD26
P3.1/LCD25
P3.0/LCD24
P2.7/LCD23
P2.6/LCD22
P2.5/LCD21
P2.4/LCD20
P2.3/LCD19
P2.2/LCD18
P2.1/LCD17
P0.2/LCD2
38
Figure 4.1. CP2400-GQ Pinout (SPI Interface)
P0.0/LCD0
P0.1/LCD1
48
47
46
45
44
43
42
41
40
39
XTAL1 XTAL2 VDD GND P4.3/COM3 P4.2/COM2 P4.1/COM1 P4.0/COM0 P3.7/LCD31 P3.6/LCD30 P3.5/LCD29 P3.4/LCD28
37
P0.3/LCD3
SMBAD0
PWR
CAP
SDA
RST
CLK
SCL
INT
P2.0/LCD16
24
1 2 3 4 5 6 7 8 9 10 11 12
36 35 34 33 32
P0.4/LCD4 P0.5/LCD5 P0.6/LCD6 P0.7/LCD7 P1.0/LCD8 P1.1/LCD9 P1.2/LCD10 P1.3/LCD11 P1.4/LCD12 P1.5/LCD13 P1.6/LCD14 P1.7/LCD15
CP2401 - GQ Top View
31 30 29 28 27 26 25
13
14
15
16
17
18
19
20
21
22
23
P3.3/LCD27
P3.2/LCD26
P3.1/LCD25
P3.0/LCD24
P2.7/LCD23
P2.6/LCD22
P2.5/LCD21
P2.4/LCD20
P2.3/LCD19
P2.2/LCD18
P2.1/LCD17
Figure 4.2. CP2401-GQ Pinout (SMBus/I2C Interface)
Rev. 1.0
P2.0/LCD16
24
21
CP2400/1/2/3
P0.0/LCD0 P0.1/LCD1 P0.2/LCD2 38 P0.3/LCD3 37 MISO 42 MOSI
CAP
NSS
48
47
46
45
44
43
41
SCK
RST
CLK
INT
40
39
XTAL1 XTAL2 VDD GND P4.3/COM 3 P4.2/COM 2 P4.1/COM 1 P4.0/COM 0 P3.7/LCD31 P3.6/LCD30 P3.5/LCD29 P3.4/LCD28
1 2 3 4 5 6 7 8 9 10 11 12
36 35 34 33 32
P0.4/LCD4 P0.5/LCD5 P0.6/LCD6 P0.7/LCD7 P1.0/LCD8 P1.1/LCD9 P1.2/LCD10 P1.3/LCD11 P1.4/LCD12 P1.5/LCD13 P1.6/LCD14 P1.7/LCD15
CP2400 - GM Top View
31 30 29 28 27
GND
26 25
13
14
15
16
17
18
19
20
21
22
23 P2.1/LCD17
P3.3/LCD27
P3.2/LCD26
P3.1/LCD25
P3.0/LCD24
P2.7/LCD23
P2.6/LCD22
P2.5/LCD21
P2.4/LCD20
P2.3/LCD19
P2.2/LCD18
Figure 4.3. CP2400-GM Pinout (SPI Interface)
P0.0/LCD0
P0.1/LCD1
P0.2/LCD2 38
48
47
46
45
44
43
42
41
40
39
37
P0.3/LCD3
SMBA0
PWR
SDA
CAP
RST
CLK
SCL
INT
P2.0/LCD16
24
XTAL1 XTAL2 VDD GND P4.3/COM3 P4.2/COM2 P4.1/COM1 P4.0/COM0 P3.7/LCD31 P3.6/LCD30 P3.5/LCD29 P3.4/LCD28
1 2 3 4 5 6 7 8 9 10 11 12
36 35 34 33 32
P0.4/LCD4 P0.5/LCD5 P0.6/LCD6 P0.7/LCD7 P1.0/LCD8 P1.1/LCD9 P1.2/LCD10 P1.3/LCD11 P1.4/LCD12 P1.5/LCD13 P1.6/LCD14 P1.7/LCD15
CP2401 - GM Top View
31 30 29 28 27
GND
26 25
13
14
15
16
17
18
19
20
21
22
23 P2.1/LCD17
P3.3/LCD27
P3.2/LCD26
P3.1/LCD25
P3.0/LCD24
P2.7/LCD23
P2.6/LCD22
P2.5/LCD21
P2.4/LCD20
P2.3/LCD19
P2.2/LCD18
Figure 4.4. CP2401-GM Pinout (SMBus/I2C Interface)
22 Rev. 1.0
P2.0/LCD16
24
CP2400/1/2/3
MISO 26
MOSI
CAP
NSS
32
31
30
29
28
27
25
SCK
RST
CLK
INT
XTAL1 XTAL2 VDD GND P2.3/COM3 P2.2/COM2 P2.1/COM1 P2.0/COM0
1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 9
GND
24 23 22
P0.0/LCD0 P0.1/LCD1 P0.2/LCD2 P0.3/LCD3 P0.4/LCD4 P0.5/LCD5 P0.6/LCD6 P0.7/LCD7
CP2402 - GM Top View
21 20 19 18 17
P1.1/LCD9
P1.7/LCD15
P1.6/LCD14
P1.5/LCD13
P1.4/LCD12
P1.3/LCD11
Figure 4.5. CP2402-GM Pinout (SPI Interface)
P1.2/LCD10
32
31
30
29
28
27
26
25
SMBA0
PWR
SDA
CAP
RST
SCL
CLK
INT
P1.0/LCD8
XTAL1 XTAL2 VDD GND P2.3/COM3 P2.2/COM2 P2.1/COM1 P2.0/COM0
1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 9
GND
24 23 22
P0.0/LCD0 P0.1/LCD1 P0.2/LCD2 P0.3/LCD3 P0.4/LCD4 P0.5/LCD5 P0.6/LCD6 P0.7/LCD7
CP2403 - GM Top View
21 20 19 18 17
P1.1/LCD9
P1.7/LCD15
P1.6/LCD14
P1.5/LCD13
P1.4/LCD12
P1.3/LCD11
Figure 4.6. CP2403-GM Pinout (SMBus Interface)
Rev. 1.0
P1.2/LCD10
P1.0/LCD8
23
CP2400/1/2/3
Notes: 1. All dimensions shown are in millimeters (mm) unless otherwise noted. 2. Dimensioning and Tolerancing per ANSI Y14.5M-1994. 3. This drawing conforms to JEDEC outline MO-220, variation VKKD-4 except for features D2 and L which are toleranced per supplier designation. 4. Recommended card reflow profile is per the JEDEC/IPC J-STD-020 specification for Small Body Components.
Figure 4.7. QFN-48 Package Drawing
24
Rev. 1.0
CP2400/1/2/3
Figure 4.8. QFN-48 Landing Diagram
Rev. 1.0
25
CP2400/1/2/3
Table 4.1. PCB Land Pattern
Dimension C1 C2 e X1 X2 Y1 Y2
Notes:
MIN 6.80 6.80 0.50 BSC 0.20 4.00 0.75 4.00
MAX 6.90 6.90
0.30 4.10 0.85 4.10
General
3. 4. 5. 6.
All dimensions shown are in millimeters (mm) unless otherwise noted. Dimensioning and Tolerancing is per the ANSI Y14.5M-1994 specification. This Land Pattern Design is based on IPC-SM-782 guidelines. All dimensions shown are at Maximum Material Condition (MMC). Least Material Condition (LMC) is calculated based on a Fabrication Allowance of 0.05 mm.
Solder Mask Design
1. All metal pads are to be non-solder mask defined (NSMD). Clearance between the solder mask and the metal pad is to be 60 m minimum, all the way around the pad.
Stencil Design
1. A stainless steel, laser-cut and electro-polished stencil with trapezoidal walls should be used to assure good solder paste release. 2. The stencil thickness should be 0.125 mm (5 mils). 3. The ratio of stencil aperture to land pad size should be 1:1 for all perimeter pads. 4. A 3 x 3 array of 1.20 mm square openings on 1.40 mm pitch should be used for the center ground pad.
Card Assembly
1. A No-Clean, Type-3 solder paste is recommended. 2. The recommended card reflow profile is per the JEDEC/IPC J-STD-020 specification for Small Body Components.
26
Rev. 1.0
CP2400/1/2/3
Figure 4.9. TQFP-48 Package Diagram
Table 4.2. TQFP-48 Package Dimensions
Dimension
A A1 A2 b c D D1 e E E1 L aaa bbb ccc ddd
Min
-- 0.05 0.95 0.17 0.09
Nom
-- -- 1.00 0.22 -- 9.00 BSC 7.00 BSC 0.50 BSC 9.00 BSC 7.00 BSC 0.60 0.20 0.20 0.08 0.08 3.5
Max
1.20 0.15 1.05 0.27 0.20
0.45
0.75
0
7
Notes: 1. All dimensions shown are in millimeters (mm) unless otherwise noted. 2. Dimensioning and Tolerancing per ANSI Y14.5M-1994. 3. This drawing conforms to JEDEC outline MS-026, variation ABC. 4. Recommended card reflow profile is per the JEDEC/IPC J-STD-020C specification for Small Body Components.
Rev. 1.0
27
CP2400/1/2/3
Figure 4.10. TQFP-48 Recommended PCB Land Pattern
Table 4.3. TQFP-48 PCB Land Pattern Dimensions
Dimension Min Max
C1 C2 E X1 Y1
8.30 8.30 0.50 BSC 0.20 1.40
8.40 8.40 0.30 1.50
Notes: General: 1. All dimensions shown are in millimeters (mm) unless otherwise noted. 2. This Land Pattern Design is based on the IPC-7351 guidelines. Solder Mask Design: 3. All metal pads are to be non-solder mask defined (NSMD). Clearance between the solder mask and the metal pad is to be 60 m minimum, all the way around the pad. Stencil Design: 4. A stainless steel, laser-cut and electro-polished stencil with trapezoidal walls should be used to assure good solder paste release. 5. The stencil thickness should be 0.125 mm (5 mils). 6. The ratio of stencil aperture to land pad size should be 1:1 for all pads. Card Assembly: 7. A No-Clean, Type-3 solder paste is recommended. 8. The recommended card reflow profile is per the JEDEC/IPC J-STD-020 specification for Small Body Components.
28
Rev. 1.0
CP2400/1/2/3
Figure 4.11. QFN-32 Package Drawing Table 4.4. QFN-32 Package Dimensions
Dimension A A1 b D D2 e E Min 0.80 0.00 0.18 3.20 Typ 0.9 0.02 0.25 5.00 BSC 3.30 0.50 BSC 5.00 BSC Max 1.00 0.05 0.30 3.40 Dimension E2 L L1 aaa bbb ddd eee Min 3.20 0.30 0.00 -- -- -- -- Typ 3.30 0.40 -- -- -- -- -- Max 3.40 0.50 0.15 0.15 0.10 0.05 0.08
Notes: 1. All dimensions shown are in millimeters (mm) unless otherwise noted. 2. Dimensioning and Tolerancing per ANSI Y14.5M-1994. 3. This drawing conforms to the JEDEC Solid State Outline MO-220, variation VHHD except for custom features D2, E2, and L which are toleranced per supplier designation. 4. Recommended card reflow profile is per the JEDEC/IPC J-STD-020 specification for Small Body Components.
Rev. 1.0
29
CP2400/1/2/3
Figure 4.12. Typical QFN-32 Landing Diagram
30
Rev. 1.0
CP2400/1/2/3
Table 4.5. PCB Land Pattern
Dimension C1 C2 E X1 X2 Y1 Y2
Notes:
MIN 4.80 4.80 0.50 BSC 0.20 3.20 0.75 3.20
MAX 4.90 4.90 0.30 3.40 0.85 3.40
General
1. 2. 3. 4.
All dimensions shown are in millimeters (mm) unless otherwise noted. Dimensioning and Tolerancing is per the ANSI Y14.5M-1994 specification. This Land Pattern Design is based on the IPC-7351 guidelines. All dimensions shown are at Maximum Material Condition (MMC). Least Material Condition (LMC) is calculated based on a Fabrication Allowance of 0.05 mm.
Solder Mask Design
1. All metal pads are to be non-solder mask defined (NSMD). Clearance between the solder mask and the metal pad is to be 60 m minimum, all the way around the pad.
Stencil Design
1. A stainless steel, laser-cut and electro-polished stencil with trapezoidal walls should be used to assure good solder paste release. 2. The stencil thickness should be 0.125 mm (5 mils). 3. The ratio of stencil aperture to land pad size should be 1:1 for all perimeter pads. 4. A 3 x 3 array of 1.0 mm square openings on 1.25 mm pitch should be used for the center ground pad.
Card Assembly
1. A No-Clean, Type-3 solder paste is recommended. 2. The recommended card reflow profile is per the JEDEC/IPC J-STD-020 specification for Small Body Components.
Rev. 1.0
31
CP2400/1/2/3
5. Clocking Options
CP2400/1/2/3 devices include a 20 MHz internal oscillator that is selected as the system clock source upon reset. Additional clocking options include an external CMOS clock input, the internal oscillator divided by 2, 4, or 8, and the SmaRTClock real time clock oscillator. The system clock source is selected using the CLKSEL register. The system clock selection may always be overridden by an external CMOS clock if the CLKOVR bit (MSCN.2) is set.
CLKSEL
CLKSL5 CLKSL4 CLKSL3 CLKSL2 CLKSL1 CLKSL0
M SC N
CLKOVR CM O S Clock SYSCLK
XTAL1 32.768 kHz XTAL2 Sm aRTClock O scillator
CM O S Clock
CLK 8 20 M Hz Internal O scillator 4 2
Figure 5.1. Clocking Options
SFR Definition 5.1. CLKSL: Clock Select
Bit Name Type Reset R/W 0 R/W 0 R/W 0 R/W 0 R/W 0 0 7 6 5 4 3 2 1 CLKSL R/W 0 0 0
Internal Register Address = 0x32
Bit Name Function
7:3 2:0
Unused CLKSL
Read = 00000. Write = Don't Care. System Clock Select. Selects the oscillator to be used as system clock source. 000: Internal oscillator divided by 1. 001: Internal oscillator divided by 2. 010: Internal oscillator divided by 4. 011: Internal oscillator divided by 8. 100: CMOS clock (CLK pin). 101: SmaRTClock oscillator. All other values reserved.
32
Rev. 1.0
CP2400/1/2/3
SFR Definition 5.2. IOSCCN: Internal Oscillator Control
Bit Name Type Reset R/W 0 R/W 0 R/W 0 R/W 0 7 6 5 4 3 Reserved R/W 0 1 2 INTCTL 1 OSCEN R/W 1 0 0 EXTCTL
Internal Register Address = 0x33
Bit Name Function
7:4 3 2
Unused
Read = 00000. Write = Don't Care.
Reserved Read = 0. Write = Must Write 0b. INTCTL
Oscillator Internal Control Enable.
When set to 1, forces the oscillator to remain enabled. Setting this bit to 0 will gate the clock output, but will not disable the oscillator. 1 OSCEN
Internal Oscillator Enable.
When set to 0, disables power to the internal oscillator. When set to 1, allows the internal oscillator to be powered (under the control of INTCTL and EXTCTL). 0 EXTCTL
Oscillator External Control Enable.
When set to 1 and INTCTL is cleared to 0, a rising edge on CLK will cause the internal oscillator to be disabled. The internal oscillator is re-enabled by the next falling edge on CLK.
Note: To control the internal oscillator enable from an external pin (EXTCTL = 1, INTCTL = 0), first write both bits to logic 1, then clear the INTCTL bit. See Section "9.2. RAM Preservation Mode" on page 50 for information on how to place the device in RAM Preservation Mode. When running from an external clock, the internal oscillator may be disabled by writing 0x00 to IOSCCN.
SFR Definition 5.3. REVID: Revision Identification
Bit Name Type Reset Varies Varies Varies Varies 7 6 5 4 REVID[7:0] R/W Varies Varies Varies Varies 3 2 1 0
Internal Register Address = 0x34 Bit Name 7:0 REVID[7:0] Revision ID.
Function
Indicates the device revision. For example 0x01 indicates Revision C.
Rev. 1.0
33
CP2400/1/2/3
6. Internal Registers and Memory
The CP2400/1/2/3 is controlled by internal registers and provides the system with up to 256 bytes of additional RAM. The internal registers and memory are controlled through an indirect interface accessible through a 4-wire SPI interface (CP2400/2) or 2-wire SMBus/I2C interface (CP2401/3). A memory map of the internal registers and RAM is shown in Figure 6.1. The internal registers are listed in "6.3. Internal Registers" on page 37.
Internal Registers 0x0000 - 0x00FF Reserved 0x0100 - 0x03FF
Static RAM (256 Bytes) 0x0400 - 0x04FF
ADDRH:ADDRL
Figure 6.1. Internal Register and RAM Memory Map
34
Rev. 1.0
CP2400/1/2/3
6.1. Accessing Internal Registers and RAM over the SPI Interface
The SPI interface supports 6 commands which provide access to all internal registers and RAM. The six commands are listed in Table 6.1. Detailed information on the SPI interface including bus timing can be found in Section "14. Serial Peripheral Interface (SPI)" on page 101.
Table 6.1. SPI Command Set
Command REGPOLL REGREAD REGSET REGWRITE RAMREAD RAMWRITE OPCODE 0x01 0x02 0x03 0x04 0x06 0x08 Description Reads data from a single register. Used for polling a status bit. Reads one or more bytes from registers with sequential addresses. Writes one or more bytes to a single register. Used for generating a waveform on a GPIO pin or updating the SmaRTClock registers. Writes one or more bytes to registers with sequential addresses. Reads one or more bytes from sequential RAM locations. Writes one or more bytes to sequential RAM locations.
Figure 6.2 shows a typical SPI transfer used to access internal registers or RAM. The first three bytes of the transfer are interpreted as COMMAND, ADDRH, and ADDRL. On a read, the fourth byte is a wait state in which the SPI shift register contents are ignored; starting with the fifth byte, data transfer begins. On a write, the fourth byte is the first data byte. The direction of data transfer depends on the specified command. The SPI transaction ends when NSS is de-asserted.
Write: COMMAND Read: COMMAND ADDRH ADDRL WAIT DATA 0 DATA N ADDRH ADDRL DATA 0 DATA 1 DATA N
Figure 6.2. SPI Transfer
Note: Using the RAMREAD command to read an address outside the 0x400-0x4FF range will result in a data value of 0xDE.
Rev. 1.0
35
CP2400/1/2/3
6.2. Accessing Internal Registers and RAM over the SMBus Interface
The SMBus interface supports 6 commands which provide access to all internal registers and RAM. The six commands are listed in Table 6.2. Detailed information on the SMBus interface including bus timing can be found in Section "15. SMBus Interface" on page 104.
Table 6.2. SMBus Command Set
Command REGPOLL REGREAD REGSET REGWRITE RAMREAD RAMWRITE OPCODE 0x01 0x02 0x03 0x04 0x06 0x08 Description Reads data from a single register. Used for polling a status bit. Reads one or more bytes from registers with sequential addresses. Writes one or more bytes to a single register. Used for generating a waveform on a GPIO pin or updating the SmaRTClock registers. Writes one or more bytes to registers with sequential addresses. Reads one or more bytes from sequential RAM locations. Writes one or more bytes to sequential RAM locations.
Figure 6.3 shows typical SMBus read and write transfers used to access internal registers or RAM. The first three bytes of a write transfer are interpreted as COMMAND, ADDRH, and ADDRL. For the REGPOLL, REGREAD, and RAMREAD commands, a repeated start is required to begin data transfer. The host controller may also choose to end the transfer with a STOP and then start a new read transfer using the same setup information. For the WRITE and RAMWRITE command, an SMBus write transfer is required. Starting with the fourth byte following the slave address, all bytes written are interpreted as data. The SMBus transfer ends when the host sends a STOP.
SMBus Read (Setup):
S SLA W A COMMAND A ADDRH A ADDRL A
+ Data Transfer or STOP
SMBus Read (Data Transfer):
S R SLA R A Data 0 A Data N N P
SMBus Write:
S SLA W A COMMAND A ADDRH A ADDRL A Data 0 A Data N A P
Received by CP240x Transmitted by CP240x
S = START R = REPEATED START P = STOP A = ACK N = NACK
R = READ W = WRITE SLA = Slave Address
Figure 6.3. SMBus Transfers
Note: Using the RAMREAD command to read an address outside the 0x400-0x4FF range will result in a data value of 0xDE.
36
Rev. 1.0
CP2400/1/2/3
6.3. Internal Registers
The CP2400/1/2/3 internal registers are grouped into categories based on function. The memory map is organized to minimize register access time, by sequentially locating registers that can be read or written with a single block read or write. Table 6.3 shows the register memory map for all registers available on the device.
Table 6.3. Internal Register Memory Map
Register Address Description Preserved Page No.
SmaRTClock Registers RTCKEY RTCADR RTCDAT INT0EN INT1EN CLKSL IOSCCN REVID INT0RD INT1RD ULPST INT0 INT1 TMR0RLL TMR0RLH TMR0L TMR0H TMR0CN TMR1RLL TMR1RLH TMR1L TMR1H TMR1CN SMBus Registers SMBCF LCD0BLINK ULPMEM00 ULPMEM01 ULPMEM02 0x68 0x80 0x81 0x82 0x83 SMBus Configuration LCD0 Segment Blink ULP Memory Byte 0 ULP Memory Byte 1 ULP Memory Byte 2 N Y Y Y Y 107 91 57 57 57 ULP/LCD0 Data Registers 0x0A 0x0B 0x0C 0x30 0x31 0x32 0x33 0x34 0x40 0x41 0x42 0x43 0x44 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 RTC0 Indirect Address RTC0 Indirect Data RTC0 Lock and Key Interrupt Enable Register 0 Interrupt Enable Register 1 Clock Select Internal Oscillator Control Revision Identifier Interrupt Status Register 0 (read-only) Interrupt Status Register 1 (read-only) Ultra Low Power Status Interrupt Status Register 0 (self-clearing) Interrupt Status Register 1 (self-clearing) Timer 0 Reload Register Low Byte Timer 0 Reload Register High Byte Timer 0 Low Byte Timer 0 High Byte Timer 0 Control Timer 1 Reload Register Low Byte Timer 1 Reload Register High Byte Timer 1 Low Byte Timer 1 High Byte Timer 1 Control N N N N N N N Y N N Y N N N N N N N N N N N N 72 73 73 43 46 32 33 33 42 45 55 41 44 94 94 95 95 93 99 99 100 100 98
Interrupt Mask and Clocking Registers
Interrupt Status Registers
Timer 0 and Timer 1 Registers
Rev. 1.0
37
CP2400/1/2/3
Table 6.3. Internal Register Memory Map (Continued)
Register ULPMEM03 ULPMEM04 ULPMEM05 ULPMEM06 ULPMEM07 ULPMEM08 ULPMEM09 ULPMEM10 ULPMEM11 ULPMEM12 ULPMEM13 ULPMEM14 ULPMEM15 LCD0CN CONTRAST LCD0CF LCD0DIVL LCD0DIVH LCD0TOGR LCD0PWR MSCN MSCF ULPCN P0OUT P1OUT P2OUT P3OUT P4OUT P0MDI P1MDI P2MDI P3MDI P4MDI P0MDO P1MDO P2MDO P3MDO Address 0x84 0x85 0x86 0x87 0x88 0x89 0x8A 0x8B 0x8C 0x8D 0x8E 0x8F 0x90 0x95 0x96 0x97 0x98 0x99 0x9A 0x9B 0xA0 0xA1 0xA2 0xB0 0xB1 0xB2 0xB3 0xB4 0xB5 0xB6 0xB7 0xB8 0xB9 0xBA 0xBB 0xBC 0xBD Description ULP Memory Byte 3 ULP Memory Byte 4 ULP Memory Byte 5 ULP Memory Byte 6 ULP Memory Byte 7 ULP Memory Byte 8 ULP Memory Byte 9 ULP Memory Byte 10 ULP Memory Byte 11 ULP Memory Byte 12 ULP Memory Byte 13 ULP Memory Byte 14 ULP Memory Byte 15 LCD0 Control LCD0 Contrast Adjustment LCD0 Configuration LCD0 Clock Divider High Byte LCD0 Clock Divider Low Byte LCD0 Toggle Rate LCD0 Power Mode Master Control Master Configuration Ultra Low Power Control Port 0 Output Data Latch Port 1 Output Data Latch Port 2 Output Data Latch Port 3 Output Data Latch Port 4 Output Data Latch Port 0 Input Mode Port 1 Input Mode Port 2 Input Mode Port 3 Input Mode Port 4 Input Mode Port 0 Output Mode Port 1 Output Mode Port 2 Output Mode Port 3 Output Mode Preserved Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y N N N N N N N N N N N N N N Page No. 57 57 57 57 57 57 57 57 57 57 57 57 57 84 85 86 87 87 88 89 58 59 54 66 66 66 66 66 67 67 67 67 67 67 67 67 67
LCD Control Registers
Ultra Low Power Control Registers
Port I/O Configuration Registers
38
Rev. 1.0
CP2400/1/2/3
Table 6.3. Internal Register Memory Map (Continued)
Register P4MDO P0DRIVE P1DRIVE P2DRIVE P3DRIVE P4DRIVE P0MATCH P1MATCH P2MATCH P3MATCH P4MATCH P0MSK P1MSK P2MSK P3MSK P4MSK PMATCHST P0IN P1IN P2IN P3IN P4IN Address 0xBE 0xBF 0xC0 0xC1 0xC2 0xC3 0xC4 0xC5 0xC6 0xC7 0xC8 0xC9 0xCA 0xCB 0xCC 0xCD 0xD0 0xD1 0xD2 0xD3 0xD4 0xD5 Description Port 4 Output Mode Port 0 Drive Strength Port 1 Drive Strength Port 2 Drive Strength Port 3 Drive Strength Port 4 Drive Strength Port 0 Match Port 1 Match Port 2 Match Port 3 Match Port 4 Match Port 0 Mask Port 1 Mask Port 2 Mask Port 3 Mask Port 4 Mask Port Match Status Port 0 Input Port 1 Input Port 2 Input Port 3 Input Port 4 Input Preserved N N N N N N N N N N N N N N N N N N N N N N Page No. 67 68 68 68 68 68 64 64 64 64 64 64 64 64 64 64 63 66 66 66 66 66
Port I/O Input and Status Registers
Rev. 1.0
39
CP2400/1/2/3
7. Interrupt Sources
The CP2400/1/2/3 can alert the host processor when any of the interrupt source events listed in Table 7.1 triggers an interrupt. The CP2400/1/2/3 alerts the host of pending interrupt events by setting the appropriate flags in the interrupt status registers and driving the INT pin low. The INT pin will remain asserted until all interrupt flags for enabled interrupts have been cleared by the host. Interrupt flags are cleared by reading the self-clearing interrupt status registers, INT0 and INT1. Interrupts can be disabled by clearing the corresponding bits in INT0EN and INT1EN.
Note: When SmaRTClock interrupts are enabled, they are also captured in the ULPST register. If the bits in ULPST are set, then the SmaRTClock interrupt flags in the INT0 register will not clear. To clear SmaRTClock interrupt events, first clear the ULPST register then clear INT0.
If the host processor does not utilize the INT pin, it can periodically read the interrupt status registers to determine if any interrupt-generating events have occurred. The INT0RD and INT1RD read-only registers provide a method of checking for interrupts without clearing the interrupt status registers.
Table 7.1. Interrupt Source Events
Event SmaRTClock Alarm SmaRTClock Oscillator Failure Port Match Reset Complete Timer 1 Overflow Description A SmaRTClock Alarm has occurred. The SmaRTClock Oscillator has experienced a failure. A Port Match event has occurred. The device is now initialized and ready to communicate over the host interface. Timer 1 has overflowed from 0xFFFF to 0x0000 or a SmaRTClock capture event has occurred. Timer 0 has overflowed from 0xFFFF to 0x0000. Pending Flag INT0.4 INT0.3 INT0.0 INT1.4 INT1.3 Enable Flag INT0EN.4 INT0EN.3 INT0EN.0 INT1EN.4 INT1EN.3
Timer 0 Overflow
INT1.2
INT1EN.2
40
Rev. 1.0
CP2400/1/2/3
SFR Definition 7.1. INT0: Interrupt Status Register 0 (Self-Clearing)
Bit Name Type Reset R 0 R 0 7 6 5 Reserved R 0 4 ALRM R 0 3 RTCFAIL R 0 R 0 R 0 2 1 0 PMINT R 0
Address = 0x43 Bit Name 7:6 5 4 Unused Reserved ALRM Read = 00b. Read = 0.
Function
SmaRTClock Alarm Interrupt Flag. 0: No SmaRTClock Alarm pending since ALRM was last cleared. 1: SmaRTClock Alarm pending. SmaRTClock Oscillator Fail Interrupt Flag. 0: No SmaRTClock oscillator failure events detected since RTCFAIL was last cleared. 1: SmaRTClock oscillator failure detected. Read = 00b. Port Match Interrupt Flag. 0: No Port Match events detected since PMINT was last cleared. 1: Port Match event pending.
3
RTCFAIL
2:1 0
Unused PMINT
Rev. 1.0
41
CP2400/1/2/3
SFR Definition 7.2. INT0RD: Interrupt Status Register 0 (Read-Only)
Bit Name Type Reset R 0 R 0 7 6 5 Reserved R 0 4 ALRMR R 0 3 RTCFAILR R 0 R 0 R 0 2 1 0 PMINTR R 0
Address = 0x40 Bit Name 7:6 5 4 Unused Reserved ALRMR Read = 00b. Read = 0.
Function
SmaRTClock Alarm Interrupt Flag. 0: No SmaRTClock Alarm pending since ALRM was last cleared. 1: SmaRTClock Alarm pending. SmaRTClock Oscillator Fail Interrupt Flag. 0: No SmaRTClock oscillator failure events detected since RTCFAIL was last cleared. 1: SmaRTClock oscillator failure detected. Read = 00b. Port Match Interrupt Flag. 0: No Port Match events detected since PMINT was last cleared. 1: Port Match event pending.
3
RTCFAILR
2:1 0
Unused PMINTR
42
Rev. 1.0
CP2400/1/2/3
SFR Definition 7.3. INT0EN: Interrupt Enable Register 0
Bit Name Type Reset R/W 1 R/W 1 7 6 5 Reserved R/W 1 4 EALRM R/W 1 3 ERTCFAIL R/W 0 Function Read = 11b. Write = don't care. Enable SmaRTClock Alarm Interrupt. This bit sets the masking of the SmaRTClock Alarm interrupt. 0: Disable SmaRTClock Alarm interrupts. 1: Enable interrupt requests generated by SmaRTClock Alarm Events. R/W 1 R/W 1 2 1 0 EPMINT R/W 1
Address = 0x30 Bit Name 7:6 5 4 Unused EALRM Reserved Read = varies. Write = must write 0b.
3
ERTCFAIL Enable SmaRTClock Fail Interrupt. This bit sets the masking of the SmaRTClock Oscillator Fail interrupt. 0: Disable SmaRTClock Oscillator Fail interrupt. 1: Enable interrupt requests generated by SmaRTClock Oscillator Failure. Unused EPMINT Read = 11b. Write = don't care. Enable Port Match Interrupt. This bit sets the masking of Port Match Interrupt. 0: Disable Port Match Interrupt. 1: Enable interrupt requests generated by Port Match events.
2:1 0
Rev. 1.0
43
CP2400/1/2/3
SFR Definition 7.4. INT1: Interrupt Status Register 1 (Self-Clearing)
Bit Name Type Reset R 0 R 0 R 0 7 6 5 4 RSTC R 0 3 T1F R 0 Function Read = 000b. Reset Complete Interrupt Flag. 0: Device has not yet finished initialization. 1: Device is ready for communication over the host interface. Timer 1 Overflow Interrupt Flag. 0: Timer 1 has not overflowed and no capture events have occurred since T1F was last cleared. 1: Timer 1 has overflowed or a capture event has occurred since T1F was last cleared. Timer 0 Overflow Interrupt Flag. 0: Timer 0has not overflowed since T0F was last cleared. 1: Timer 0 has overflowed since T0F was last cleared. Read = 00b. 2 T0F R 1 R 0 R 0 1 0
Address = 0x44 Bit Name 7:5 4 Unused RSTC
3
T1F
2
T0F
1:0
Unused
44
Rev. 1.0
CP2400/1/2/3
SFR Definition 7.5. INT1RD: Interrupt Status Register 1 (Read-Only)
Bit Name Type Reset R 0 R 0 R 0 7 6 5 4 RSTCR R 1 3 T1FR R 0 Function Read = 000b. Reset Complete Interrupt Flag. 0: Device has not yet finished initialization. 1: Device is ready for communication over the host interface. Timer 1 Overflow Interrupt Flag. 0: Timer 1 has not overflowed and no capture events have occurred since T1F was last cleared. 1: Timer 1 has overflowed or a capture event has occurred since T1F was last cleared. Timer 0 Overflow Interrupt Flag. 0: Timer 0has not overflowed since T0F was last cleared. 1: Timer 0 has overflowed since T0F was last cleared. Read = 00b. 2 T0FR R 1 R 0 R 0 1 0
Address = 0x41 Bit Name 7:5 4 Unused RSTCR
3
T1FR
2
T0FR
1:0
Unused
Rev. 1.0
45
CP2400/1/2/3
SFR Definition 7.6. INT1EN: Interrupt Enable Register 1
Bit Name Type Reset R/W 1 R/W 1 R/W 1 7 6 5 4 ERSTC R/W 1 3 ET1F R/W 1 Function Read = 111. Write = don't care. Enable Reset Complete Interrupt. 0: Disable Reset Complete interrupt. 1: Enable interrupt requests generated when device is ready for communication over the host interface. Enable Timer 1 Overflow Interrupt. 0: Disable Timer 1 Overflow Interrupt. 1: Enable interrupt requests generated by Timer 1. Enable Timer 0 Overflow Interrupt. 0: Disable Timer 0 Overflow Interrupt. 1: Enable interrupt requests generated by Timer 0. Read = 11. Write = don't care. 2 ET0F R/W 1 R/W 1 R/W 1 1 0
Address = 0x31 Bit Name 7:5 4 Unused ERSTC
3
ET1F
2
ET0F
1:0
Unused
46
Rev. 1.0
CP2400/1/2/3
8. Reset Sources
Reset circuitry allows the CP2400/1/2/3 to be easily placed in a predefined default condition. Upon entry to this reset state, the following events occur:
All direct and indirect registers are initialized to their defined reset values. Port I/O pins are forced into a high impedance state with a weak pull-up to VDD.

The INT pin is forced to a logic high state. The internal oscillator is stopped. All interrupts (except SmaRTClock Oscillator Fail) are enabled. The CP2400/1/2/3 has two reset sources that place the device in the reset state. The method of entry to the reset state determines the amount of time spent in reset. Each of the following reset sources is described in the following sections:
Power-On External RST Pin Upon exit from the reset state, the device automatically starts the internal oscillator then asserts the interrupt pin. The device is fully functional after the interrupt pin is asserted.
8.1.
Reset Initialization
After every CP2400/1/2/3 reset, the following initialization procedure is recommended to ensure proper device operation: 1. Wait for the Reset Complete Interrupt (interrupt pin assertion). 2. Disable interrupts (using INT0EN and INT1EN on page 43 and page 46) for events that will not be monitored or handled by the host processor. By default, all interrupts except for SmaRTClock Oscillator Fail are enabled after every reset. 3. Configure the device for the intended mode of operation.
Rev. 1.0
47
CP2400/1/2/3
8.2. Power-On Reset
During power-up, the CP2400/1/2/3 is held in the reset state until VDD settles above VRST. A delay (TPORDelay) occurs between the time VDD reaches VRST and the time the device is released from reset. Refer to Table 3.3 for the Electrical Characteristics of the power-on reset circuit.
volts
VDD
VRST
1.0
VD D
t
Logic HIGH
/RST
TPORDelay Logic LOW
Power-On Reset
Figure 8.1. Reset Timing
8.3.
External Pin Reset
The RST pin provides a means for external circuitry to force the CP2400/1/2/3 into a reset state. Asserting RST for at least TRST will cause the CP2400/1/2/3 to enter the reset state. It is recommended to drive RST with a push-pull driver or add an external pull-up resistor to avoid erroneous noise-induced resets. The CP2400/1/2/3 will exit the reset state and generate a Reset Complete Interrupt approximately one TSTARTUP delay after a logic high is detected on RST. Refer to Table 3.3 on page 16 for the Electrical Characteristics.
48
Rev. 1.0
CP2400/1/2/3
9. Power Modes
The CP2400/1/2/3 has four power modes that can be used to minimize overall system power consumption. The power modes vary in device functionality and wake-up methods. Each of the following power modes is explained in the following sections:

Normal Mode (Device Fully Functional) RAM Preservation Mode (Internal Oscillator Disabled) Ultra Low Power LCD Mode (Regulator Disabled) Ultra Low Power SmaRTClock Mode (Regulator Disabled, LCD Disabled) Shut Down Mode (All functionality Disabled)
The power modes above are achieved by disabling specific primary functions of the CP2400/1/2/3. Figure 9.1 shows how power is distributed throughout the CP2400/1/2/3. Additional secondary functions may also be disabled to save power. These are described in Section "9.8. Disabling Secondary Device Functions" on page 58.
VDD ULP Control Logic
ULP LCD Control ULP Port Match LDO SmaRTClock
Digital Logic
Host Interface Timers
Active Port Match Internal Oscillator
SRAM
Figure 9.1. Power and Clock Distribution Control
Rev. 1.0
49
CP2400/1/2/3
9.1. Normal Mode
Normal mode should be used whenever the host controller is communicating with the CP2400/1/2/3. In this mode, the device is fully functional and the host interface is capable of operating at full speed. Typical normal mode power consumption is listed in Table 3.1 on page 12.
9.2.
RAM Preservation Mode
In RAM Preservation Mode, the internal oscillator is disabled and the SmaRTClock oscillator provides the system clock. RAM Preservation Mode should be used when the CP2400/1/2/3 needs to be active for a prolonged period of time in which communication with the host microcontroller is not required. Examples of this include preserving the contents of RAM or using the fully featured Active port match capabilities. LCD and SmaRTClock functionality remains fully functional in RAM Preservation Mode. Interrupt latency does increase in this mode. From Normal Mode, the device can be placed in RAM Preservation Mode using the following procedure: 1. 2. 3. 4. 5. Drive the CLK pin LOW. Write 0x07 to the IOSCCN register to synchronize the oscillator control logic. Write 0x03 to the IOSCCN register to switch oscillator control to the CLK pin. Write 0x05 to the CLKSL register to select SmaRTClock oscillator as the system clock. Drive the CLK pin HIGH.
From RAM Preservation Mode, the device can be returned to Normal Mode using the following procedure: 1. Drive the CLK pin LOW. This will force the system clock to Internal Oscillator divided by 1. 2. Write 0x06 to the IOSCCN register to force the internal oscillator to remain enabled. See Table 3.4 for RAM Preservation Mode wake-up time. When using the SPI Interface, the CLK pin may be tied to NSS in order to wake the device from RAM Preservation Mode on NSS falling. The CLKOVR bit (MSCN.2) must be set to logic 0 and the SmaRTClock must be enabled and running in order to place the device in RAM Preservation Mode.
50
Rev. 1.0
CP2400/1/2/3
9.3. Ultra Low Power LCD Mode
In Ultra Low Power LCD Mode, the on-chip LDO is placed in a low power state and power is gated off from all digital logic residing outside the ULP block. The ULP block allows the device to refresh an LCD, maintain a real time clock, detect SmaRTClock Alarm, SmaRTClock Oscillator Fail, and ULP Port Match events. The Port Match functionality in ULP Mode differs from the functionality of Port Match when the device is in Normal or RAM Preservation Mode. See Section "9.7. Port Match Functionality in the Ultra Low Power Modes" on page 56 for more details. All Port I/O with the exception of P3.3-P4.3 must be configured to Analog mode prior to entering ULP Mode. From Normal Mode, the device can be placed in ULP LCD Mode using the following procedure: 1. Set INT0EN:INT1EN to 0x1900. This enables the SmaRTClock Fail, SmaRTClock Alarm, and Port Match interrupts and disables all others. 2. Configure the bandgap into one of its low power modes by writing 0xC0 or 0x80 to MSCF. Choosing the loose bandgap regulation (MSCF = 0x80) will result in the lowest supply current at the expense of increased ripple in the LCD output voltage. 3. Drive the PWR or NSS pin LOW. 4. Set the LCDEN (ULPCN.3) to logic 1. If Port Match functionality is desired, also set the ULPEN (ULPCN.1) bit to logic 1. 5. Drive the PWR or NSS pin HIGH. The device will not enter ULP mode if there are pending wake-up events, and the INT pin will remain asserted. To ensure that the device has successfully entered the low power mode, the host processor should verify that there are no pending wake-up events prior to placing the device in a ULP mode and that the INT pin remains de-asserted for 100 s after placing the device in ULP mode. If the INT pin is found to be asserted, then the host controller should treat the situation as if the device has entered ULP and has been awoken by a wake-up event. The state of RAM and unpreserved registers should not be relied upon since the host controller will not be able to determine if the regulator has been disabled and re-enabled, or never disabled. The Port Match, SmaRTClock Alarm, and SmaRTClock Oscillator Fail interrupts should always be enabled any time the device is placed in a ULP mode. Once the device enters ULP LCD Mode, it will remain in this low power mode until a SmaRTClock Alarm, SmaRTClock Oscillator Fail, or ULP Port Match wake-up event occurs. Once the device wakes up, it will generate a reset complete interrupt and assert the INT pin. The host controller may also wake up the device at any time. To resume Normal Mode operation, the host controller should use the following procedure: 1. Drive the PWR or NSS pin LOW. 2. Wait for the INT pin to be asserted. See Table 3.4 for ULP Mode wake up time. 3. Re-initialize all registers which are not preserved during ULP mode. See Table 6.3 for a list of registers that preserve their state in ULP mode.
Note: The Port I/O state and configuration settings are preserved as long as the device is in the low power mode. Upon wakeup, all Port I/O state and configuration settings will reset, making all Port I/O digital inputs with weak pullups enabled. They will remain in this state until the host controller re-initializes the Port I/O state and configuration registers.
In the ULP LCD Mode, the SmaRTClock oscillator may be disabled if a low frequency CMOS clock (~32 kHz) is present at CLK pin. Set the RTCBYP bit (MSCN.7) to logic 1 in order to override the SmaRTClock with the CMOS clock available at the CLK pin. The SmaRTClock should be disabled by writing 0x00 to the indirect RTC0CN register instead of setting the RTCDIS bit (ULPCN.4) while entering ULP LCD Mode. When the SmaRTClock is disabled, SmaRTClock alarm and SmaRTClock oscillator fail detection functionality is no longer available.
Rev. 1.0
51
CP2400/1/2/3
9.4. Ultra Low Power SmaRTClock Mode
In Ultra Low Power SmaRTClock Mode, the on-chip LDO is placed in a low power state and power is gated off from all digital logic residing outside the ULP block. LCD functionality is disabled. The ULP block allows the device to maintain a real time clock and detect SmaRTClock Alarm, SmaRTClock Oscillator Fail, and ULP Port Match events. The Port Match functionality in ULP Mode differs from the functionality of Port Match when the device is in normal or RAM Preservation Mode. See Section "9.7. Port Match Functionality in the Ultra Low Power Modes" on page 56 for more details. From normal mode, the device can be placed in ULP SmaRTClock Mode using the following procedure: 1. Set INT0EN:INT1EN to 0x1900. This enables the SmaRTClock Fail, SmaRTClock Alarm, and Port Match interrupts and disables all others. 2. Place the bandgap into its lowest power mode by writing 0x80 to MSCF. 3. Drive the PWR or NSS pin LOW. 4. Set the ULPEN (ULPCN.1) bit to logic 1. If port match functionality is not desired, ensure that all the ULP Port Mask bits are set to logic 0 by writing 1 to ULPRST (ULPCN.1). 5. Drive the PWR or NSS pin HIGH. The device will not enter any ULP mode if there are pending wake-up events, and the INT pin will remain asserted. To ensure that the device has successfully entered the low power mode, the host processor should verify that there are no pending wake-up events prior to placing the device in a ULP mode and that the INT pin remains de-asserted for 100 us after placing the device in ULP mode. If the INT pin is found to be asserted, then the host controller should treat the situation as if the device has entered ULP and has been awoken by a wake-up event. The state of RAM and unpreserved registers should not be relied upon since the host controller will not be able to determine if the regulator has been disabled and re-enabled, or never disabled. The Port Match, SmaRTClock Alarm, and SmaRTClock Oscillator Fail interrupts should always be enabled any time the device is placed in a ULP mode. Once the device enters ULP SmaRTClock Mode, it will remain in this low power mode until a SmaRTClock Alarm, SmaRTClock Oscillator Fail, or ULP Port Match wake-up event occurs. Once the device wakes up, it will generate a reset complete interrupt and assert the INT pin. The host controller may also wake up the device at any time. To resume normal mode operation, the host controller should use the following procedure: 1. Drive the PWR or NSS pin LOW. 2. Wait for the INT pin to be asserted. See Table 3.4 for ULP Mode wake up time. 3. Re-initialize all registers which are not preserved during ULP mode. See Table 6.3 for a list of registers that preserve their state in ULP mode.
Note: The Port I/O state and configuration settings are preserved as long as the device is in the low power mode. Upon wakeup, all Port I/O state and configuration settings will reset, making all Port I/O digital inputs with weak pullups enabled. They will remain in this state until the host controller re-initializes the Port I/O state and configuration registers.
In the ULP SmaRTClock Mode, the SmaRTClock oscillator may be disabled if a low frequency CMOS clock (~32 kHz) is present at CLK pin. Set the RTCBYP bit (MSCN.7) to logic 1 in order to override the SmaRTClock with the CMOS clock available at the CLK pin. The SmaRTClock should be disabled by writing 0x00 to the indirect RTC0CN register instead of setting the RTCDIS bit (ULPCN.4). When the SmaRTClock is disabled, SmaRTClock alarm and SmaRTClock oscillator fail detection functionality is no longer available.
52
Rev. 1.0
CP2400/1/2/3
9.5. Shutdown Mode
Shutdown mode is the lowest power mode for the CP2400/1/2/3. All device functionality is disabled in this mode and a reset is required to wake up the device. This mode is typically used when the device is not needed for prolonged periods of time. From Normal Mode, the device can be placed in shutdown mode using the following procedure: 1. Set INT0EN:INT1EN to 0x1900. This enables the SmaRTClock Fail, SmaRTClock Alarm, and Port Match interrupts and disables all others. 2. Ensure that all ULP Port Mask bits are set to logic 0 by writing 1 to ULPRST (ULPCN.1). 3. Configure the bandgap for Shutdown Mode by writing 0x80 to MSCF. 4. Drive the PWR or NSS pin LOW. 5. Set the RTCDIS (ULPCN.4) and the ULPEN (ULPCN.1) bit to logic 1. 6. Drive the PWR or NSS pin HIGH. The device will not enter Shutdown if there are pending wake-up events, and the INT pin will remain asserted. To ensure that the device has successfully entered the low power mode, the host processor should verify that there are no pending wake-up events prior to placing the device in Shutdown Mode and that the INT pin remains deasserted for 100 s after placing the device in Shutdown Mode. If the INT pin is found to be asserted after the device has been placed in Shutdown, the device should be reset and placed in shutdown again. It is essential that all ULP Port Mask bits be set to logic 0 before the device is placed in Shutdown in order to prevent the possibility of a partial wake-up due to a Port Match event. The Port Match, SmaRTClock Alarm, and SmaRTClock Oscillator Fail interrupts should always be enabled any time the device is placed in Shutdown mode.
Note: The Port I/O state and configuration settings are preserved as long as the device is in Shutdown. Upon reset, all Port I/O state and configuration settings will reset, making all Port I/O digital inputs with weak pull-ups enabled. They will remain in this state until the host controller re-initializes the Port I/O state and configuration registers.
Rev. 1.0
53
CP2400/1/2/3
SFR Definition 9.1. ULPCN: Ultra Low Power Control Register
Bit Name Type Reset R/W 0 R/W 0 R/W 0 7 6 5 4 RTCDIS R/W 0 3 LCDEN R/W 0 Function Read = 000b. Write = Don't Care. Ultra Low Power Mode SmaRTClock Disable. When set to 1, the SmaRTClock oscillator will be disabled two SmaRTClock cycles after entry into ULP Mode. This allows the device to enter its Shutdown Mode. Any write operation that sets this bit to 1b must also set ULPEN to 1b. Ultra Low Power LCD Enable. When set to 1, LCD Functionality is enabled in ULP mode. Rising edge transitions on NSS and PWR disable the internal LDO and place the device into the ultra low power mode. A falling edge transition on NSS or PWR will re-enable the regulator and return the device to normal power mode. This bit is self-clearing upon wake-up from the ultra low power mode. Read = 0b. Must write 0b. Ultra Low Power Port Match Enable. When set to 1, Port Match Functionality is enabled in ULP mode. Rising edge transitions on NSS and PWR disable the internal LDO and place the device into the ultra low power mode. A falling edge transition on NSS or PWR will re-enable the regulator and return the device to normal power mode. This bit is self-clearing upon wake-up from the ultra low power mode. 2 Reserved R/W 0 1 ULPEN R/W 0 0 ULPPMPOL R/W 0
Address = 0xA2 Bit Name 7:5 4 Unused RTCDIS
3
LCDEN
2 1
Reserved ULPEN
0
ULPPMPOL Ultra Low Power Port Match Polarity. 0: ULP Port Match wake-up occurs on rising edge transitions (level sensitive). 1: ULP Port Match wake-up occurs on falling edge transitions (level sensitive).
Note: The state of ULPPMPOL should not be changed in the same write which enables the ULP modes. Rather, the state of ULPPMPOL should be set first, then the ULP mode should be enabled.
54
Rev. 1.0
CP2400/1/2/3
9.6. Determining the ULP Mode Wake-Up Source
After waking from ULP Mode, the ULPST register may be used to determine the cause of wake up. The three possible wake up sources are SmaRTClock Alarm, SmaRTClock Oscillator Failure, and ULP Port Match. If none of the bits in ULPST are set, then the wake up was due to the NSS or PWR pin falling edge. This register may be cleared by writing a 1 to the CLEAR (MSCN.6) bit in the master control register.
SFR Definition 9.2. ULPST: Ultra Low Power Status Register
Bit Name Type Reset R 0 R 0 R 0 R 0 R 0 Function Read = 00000b. Write = Don't Care. SmaRTClock Oscillator Fail Wake Up Indicator. 0: Source of last wake up was not a SmaRTClock Oscillator Fail. 1: Source of last wake up was a SmaRTClock Oscillator Fail. 7 6 5 4 3 2 RTCFAIL R 0 1 RTCALRM R 0 0 ULPPM R varies
Address = 0x42 Bit Name 7:3 2 Unused RTCFAIL
1
RTCALRM SmaRTClock Alarm Wake Up Indicator. 0: Source of last wake up was not a SmaRTClock Alarm. 1: Source of last wake up was a SmaRTClock Alarm. ULPPM Ultra Low Power Port Match Wake Up Indicator. 0: Source of last wake up was not a ULP Port Match. 1: Source of last wake up was a ULP Port Match.
0
Rev. 1.0
55
CP2400/1/2/3
9.7. Port Match Functionality in the Ultra Low Power Modes
The ultra low power LCD and SmaRTClock modes support port match wake-up. ULP SmaRTClock mode supports port match on all P0, P1, P2, and P3 pins. ULP LCD mode supports port match on P3.3, P3.4, P3.5, P3.6, and P3.7. ULP Port Match events can be generated on rising or falling edges; however, all events are configured to the same polarity using the ULPPMPOL bit (ULPCN.0). ULP Port Match is level sensitive and a new Port Match event will be generated every clock cycle as long as the I/O state matches the polarity set by the ULPPMPOL bit.
Note: In ULP LCD Mode, when using a 4-mux LCD, port match may only be used to detect rising edges.
Each Port I/O that participates in ULP Port Match is individually maskable to allow or disallow the generation of Port Match events. The most significant bit in each 4-bit nibble of ULP Memory controls the masking of a single Port I/O. For example, the masking of P3.4 and P3.5 are controlled by bit 3 and bit 7 of ULPMEM14, respectively. Table 9.1 and Table 9.2 show the ULP Mask bit locations for all I/O capable of port match when the device is in ULP SmaRTClock and ULP LCD mode, respectively. A mask setting of 0 will prevent the generation of Port Match events from the specified I/O and a mask setting of 1 will allow generation of Port Match events from the specified I/O. Port I/O to be used for ULP Port Match must be configured as digital pins. Setting the ULPRST (ULPCN.1) to logic 1 will reset all Port Mask bits to 0. ULP Port Match is enabled upon entry into ULP mode when the ULPEN bit (ULPCN.1) is set to logic 1 and disabled upon wake-up from ULP mode. The ULPST register may be used to determine when a ULP Port Match event has occurred. When enabled, the Port Match interrupt will occur when an Active Mode Port Match or ULP Port Match event occurs.
Table 9.1. ULP SmaRTClock Port Match Mask Bit Locations
ULP Memory ULPMEM00 ULPMEM01 ULPMEM02 ULPMEM03 ULPMEM04 ULPMEM05 ULPMEM06 ULPMEM07 ULPMEM08 ULPMEM09 ULPMEM10 ULPMEM11 ULPMEM12 ULPMEM13 ULPMEM14 ULPMEM15 Bit 7 Masks P0.1 P0.3 P0.5 P0.7 P1.1 P1.3 P1.5 P1.7 P2.1 P2.3 P2.5 P2.7 P3.1 P3.3 P3.5 P3.7 Bit 3 Masks P0.0 P0.2 P0.4 P0.6 P1.0 P1.2 P1.4 P1.6 P2.0 P2.2 P2.4 P2.6 P3.0 P3.2 P3.4 P3.6
Table 9.2. ULP LCD Port Match Mask Bit Locations
ULP Memory ULPMEM13 ULPMEM14 ULPMEM15 Bit 7 Masks P3.3 P3.5 P3.7 Bit 3 Masks N/A P3.4 P3.6
56
Rev. 1.0
CP2400/1/2/3
SFR Definition 9.3. ULPMEMn: ULP Memory
Bit Name Type Reset R/W 0 R/W 0 R/W 0 7 6 5 4 ULPMEMn R/W 0 R/W 0 R/W 0 R/W 0 R/W 0 3 2 1 0
Addresses: ULPMEM00 = 0x81, ULPMEM01 = 0x82, ULPMEM02 = 0x83, ULPMEM03 = 0x84, ULPMEM04 = 0x85, ULPMEM05 = 0x86, ULPMEM06 = 0x87, ULPMEM07 = 0x88, ULPMEM08 = 0x89, ULPMEM09 = 0x8A, ULPMEM10 = 0x8B, ULPMEM11 = 0x8C, ULPMEM12 = 0x8D, ULPMEM13 = 0x8E, ULPMEM14 = 0x8F, ULPMEM15 = 0x90.
Bit Name Function
7:0
ULPMEMn
ULP Memory. Each nibble controls one I/O pin. See "12.5. Mapping ULP Memory to LCD Pins" on page 90 for information on how ULP Memory is used with the LCD function. See Section "9.7. Port Match Functionality in the Ultra Low Power Modes" on page 56 for information on how ULP Memory is used with the ULP Port Match function.
Rev. 1.0
57
CP2400/1/2/3
9.8. Disabling Secondary Device Functions
The MSCN and MSCF registers provide additional ways of saving power by disabling unnecessary functionality.
SFR Definition 9.4. MSCN: Master Control Register
Bit Name Type Reset 7 RTCBYP R/W 0 6 CLEAR R/W 0 5 ADRINV R/W 0 4 RTCOD R/W 0 3 SRAMD R/W 0 2 CLKOVR R/W 0 1 ULPRST R/W 0 0 LCDEN R/W 0
Address = 0xA0 Bit Name 7 RTCBYP
Function SmaRTClock Oscillator Bypass. When set to 1, the SmaRTClock oscillator clock is bypassed and the CLK pin is used to drive the low frequency clock used for ULP operations. ULP Status Clear. Writing 1 to this register clears all bits in the ULP status register (ULPST). SRAM Address Invert. When set to 1, the least significant byte of the SRAM target address is inverted. This allows the SRAM to be accessed in reverse sequential order using a single block read or write. For example, a block read from addresses 0x0400 to 0x04FF will return data from RAM locations 0x04FF to 0x0400. SmaRTClock Oscillator Output Disable. When set to 1, the SmaRTClock oscillator output is gated off, and does not drive the low frequency clock used for ULP operations. SRAM Disable. 0: The SRAM is enabled. 1: The SRAM is disabled. System Clock Override. 0: The CLKSL register determines the system clock. 1: The system clock is the CMOS clock input through the CLK pin. ULP Memory Reset. Writing 1 to this bit clears all values in the ULP Memory to 0x00. This bit can be used to quickly set all ULP Port Mask bits to logic 0. LCD Enable. 0: LCD Functionality is disabled. 1: LCD Functionality is enabled.
6 5
CLEAR ADRINV
4
RTCOD
3
SRAMD
2
CLKOVR
1
ULPRST
0
LCDEN
58
Rev. 1.0
CP2400/1/2/3
SFR Definition 9.5. MSCF: Master Configuration Register
Bit Name Type Reset 7 6 5 Reserved R/W 0 4 Reserved R/W 0 3 Reserved R/W 0 Function 2 Reserved R/W 0 1 Reserved R/W 0 0 CPBYP R/W 0
BGMD[1:0] R/W 0 R/W 0
Address = 0xA1 Bit Name 7:6
BGMD[1:0] Band Gap Power Mode. 00: Band Gap is in Normal Power Mode. 01: Reserved. 10: Band Gap is configured for low power with loose voltage regulation (required setting for Shutdown Mode). 11: Band Gap is configured for low power with tight voltage regulation. Reserved CPBYP Read = Varies. Must write 00000b. Charge Pump Bypass. When set to 1, the charge pump is bypassed and disabled. VDD is used as the VLCD supply voltage.
5:1 0
Note: When the band gap is configured for low power mode with loose voltage regulation, the LCD0CF register should be adjusted so that charge pump cycles occur at least once every 2 ms.
Rev. 1.0
59
CP2400/1/2/3
10. Port Input/Output
CP2400/1/2/3 devices have 36 (48-pin packages) or 20 (32-pin packages) multi-function I/O pins. Port pins are organized as byte-wide ports and may be used for general purpose I/O, generating a Port Match interrupt, or for an analog function (e.g., LCD).
Note: The port match functionality described in this chapter only applies when the device is awake (Normal and Idle Power Modes). Refer to the Power Modes chapter for information on port match wake-up from ULP or shutdown mode.
All Port I/Os are 5 V tolerant when used as digital inputs or open-drain outputs. For Port I/Os configured as digital push-pull outputs, current is sourced from the VDD supply. See Section 10.1 for more information on Port I/O operating modes and the electrical specifications chapter for detailed electrical specifications. Figure shows a block diagram of the Port I/O for the 48-pin packaged devices. The 32-pin packaged devices are functionally the same, however, they have less I/O. Refer to the System Overview for a detailed block diagram of 32-pin devices.
Configuration Registers
PnMDO, PnMDI Registers
P0.0 8 (Internal Analog Signals) P0 I/O Cells P0.7 LCD 36
Port Mapping Logic
P1.0 8 P1 I/O Cells P1.7
P2.0 8 P0 (P0.0-P0.7) 8 P1 (P1.0-P1.7) 8 P2 (P0.0-P0.7) 8 P3 (P3.0-P3.7) 4 4 P4 (P4.0-P4.3) Port Match P4 I/O Cells P4.0 8 P3 I/O Cells P3.7 P3.0 8 P2 I/O Cells P2.7
(Port Latches -- Digital)
P4.3
Figure 10.1. Port I/O Diagram
60
Rev. 1.0
CP2400/1/2/3
10.1. Port I/O Modes of Operation
All port pins use the Port I/O cell shown in Figure 10.2. Each Port I/O cell can be configured by software for analog I/O or digital I/O using the PnMDI registers. On reset or wake-up from ULP mode, all Port I/O cells default to a digital high impedance state with weak pull-ups enabled.
10.1.1. Port Pins Configured for Analog I/O
Any pins to be used for LCD should be configured for analog I/O (PnMDI.n = 0). When a pin is configured for analog I/O, its weak pullup and digital output driver and receiver are disabled. Port pins configured for analog I/O will always read back a value of 0 regardless of the actual voltage on the pin.
10.1.2. Port Pins Configured For Digital I/O
Any pins to be used for GPIO or Port Match should be configured as digital I/O (PnMDI.n = 1). For digital I/O pins, one of two output modes (push-pull or open-drain) must be selected using the PnMDO registers. Push-pull outputs (PnMDO.n = 1) always drive the Port pad to the VDD or GND supply rails based on the output logic value of the Port pin. Open-drain outputs have the high side driver disabled; therefore, they only drive the Port pad to GND when the output logic value is 0 and become high impedance inputs (both high and low drivers turned off) when the output logic value is 1. When a digital I/O cell is placed in the high impedance state, a weak pull-up transistor pulls the Port pad to the VDD supply voltage to ensure the digital input is at a defined logic state. Weak pullups are disabled when the I/O cell is driven to GND to minimize power consumption. The user must ensure that digital I/O are always internally or externally pulled or driven to a valid logic state. An analog signal applied to a digital I/O pin will result in increased power consumption.
PxMDO.x (1 for push-pull) (0 for open-drain)
VDD
VDD
(WEAK) PORT PAD
PxOUT.x - Output Logic Value (Port Latch) PxMDI.x (1 for digital) (0 for analog) To/From Analog Peripheral PxIN.x - Input Logic Value (Reads 0 when pin is configured as an analog I/O)
GND
Figure 10.2. Port I/O Cell Block Diagram
Rev. 1.0
61
CP2400/1/2/3
10.1.3. Interfacing Port I/O to 5 V and 3.3 V Logic
All Port I/Os configured for digital, open-drain operation are capable of interfacing to digital logic operating at a supply voltage higher than 4.5 V and less than 5.25 V. When the supply voltage is in the range of 1.8 to 2.2 V, the I/O may also interface to digital logic operating between 3.0 to 3.6 V. An external pull-up resistor to the higher supply voltage is typically required for most systems. Important Notes:
When interfacing to a signal that is between 4.5 and 5.25 V, the maximum clock frequency that may be input on a GPIO pin is 12.5 MHz. The exception to this rule is when routing an external CMOS clock to P0.3, in which case a signal up to 25 MHz is valid as long as the rise time (10% to 90%) is shorter than 1.8 ns. When the supply voltage is less than 2.8 V and interfacing to a signal that is between 3.0 and 3.6 V, the maximum clock frequency that may be input on a GPIO pin is 3.125 MHz. The exception to this rule is when routing an external CMOS clock to P0.3, in which case a signal up to 25 MHz is valid as long as the rise time (10% to 90%) is shorter than 1.2 ns. In a multi-voltage interface, the external pull-up resistor should be sized to allow a current of at least 150 A to flow into the Port pin when the supply voltage is between (VDD_MCU/DC+ plus 0.4 V) and (VDD_MCU/DC+ plus 1.0 V). Once the Port pad voltage increases beyond this range, the current flowing into the Port pin is minimal. These guidelines only apply to multi-voltage interfaces. Port I/Os may always interface to digital logic operating at the same supply voltage.
10.1.4. Increasing Port I/O Drive Strength
Port I/O digital output drivers support a high and low drive strength; the default is low drive strength. The drive strength of a Port I/O can be configured using the PnDRIVE registers. See Table 3.2 on page 13 for the difference in output drive strength between the two modes.
10.2. Assigning Port I/O Pins to Analog and Digital Functions
Port I/O pins are multi-function and may be used for multiple purposes. The following process can be used to assign GPIO pins to their appropriate function. 1. Determine the pins to be used for the LCD function. These pins need to be configured for Analog I/O. 2. Any remaining unused pins may be used for GPIO or Port Match. These pins need to be configured for Digital I/ O. Note: ULP Port Match is only available on a limited number of pins. See Section "9.7. Port Match Functionality in the Ultra Low Power Modes" on page 56 for more details. All Port I/O with the exception of P3.3-P4.3 must be configured to Analog mode prior to entering ULP Mode.
62
Rev. 1.0
CP2400/1/2/3
10.3. Active Mode Port Match
Port match functionality allows system events to be triggered by a logic value change on a GPIO pin. A software controlled value stored in the PnMATCH registers specifies the expected or normal logic values of the associated Port. A Port mismatch event occurs if the logic levels of the Port's input pins no longer match the software controlled value. This allows software to be notified if a certain change or pattern occurs on an input pin. The PnMSK registers can be used to individually select which pins should be compared against the PnMATCH registers. A Port mismatch event is generated if (PnIN & PnMSK) does not equal (PnMATCH & PnMSK) for all Ports. A Port mismatch event may be used to generate an interrupt. See "7. Interrupt Sources" on page 40 for more details on handling an interrupt.
SFR Definition 10.1. PMATCHST: Port Match Status Register
Bit Name Type Reset
Bit
7
6
5
4 P4M
3 P3M R/W 0
Function
2 P2M R/W 0
1 P1M R/W 0
0 P0M R/W 0
R/W 0
Name
R/W 0
R/W 0
R/W 0
Address = 0xD0 7:5 4 Unused P4M Read = 000b. Write = Don't Care. Port 4 Match. 0: No port mismatch events have been detected on P4. 1: A port mismatch event is present on P4. 3 P3M Port 3 Match. 0: No port mismatch events have been detected on P3. 1: A port mismatch event is present on P3. 2 P2M Port 2 Match. 0: No port mismatch events have been detected on P2. 1: A port mismatch event is present on P2. 1 P1M Port 1 Match. 0: No port mismatch events have been detected on P1. 1: A port mismatch event is present on P1. 0 P0M Port 0 Match. 0: No port mismatch events have been detected on P0. 1: A port mismatch event is present on P0.
Rev. 1.0
63
CP2400/1/2/3
SFR Definition 10.2. PnMSK: Port n Mask Register
Bit Name Type Reset 0 0 0 0 7 6 5 4 3 2 1 0
PnMSK[7:0] R/W 0 0 0 0
Address: P0MSK = 0xC9; P1MSK = 0xCA; P2MSK = 0xCB; P3MSK = 0xCC; P4MSK = 0xCD
Bit Name Function
7:0
PnMSK[7:0]
Port n Mask Value. Selects the Pn pins to be compared with the corresponding bits in PnMATCH. 0: Pn.x pin pad logic value is ignored and cannot cause a Port Mismatch event. 1: Pn.x pin pad logic value is compared to PnMATCH.x.
SFR Definition 10.3. PnMATCH: Port n Match Register
Bit Name Type Reset 1 1 1 1 7 6 5 4 3 2 1 0
PnMATCH[7:0] R/W 1 1 1 1
Address: P0MATCH = 0xC4; P1MATCH = 0xC5; P2MATCH = 0xC6; P3MATCH = 0xC7; P4MATCH = 0xC8
Bit Name Function
7:0
PnMATCH[7:0] Port n Match Value. Match comparison value used on Port n for bits whose PnMSK is set to 1. 0: Pn.x pin logic value is compared with logic LOW. 1: Pn.x pin logic value is compared with logic HIGH.
64
Rev. 1.0
CP2400/1/2/3
10.4. Registers for Accessing and Configuring Port I/O
All Port I/O are accessed and configured through registers. When writing to a Port, the value written to the PnOUT register is latched to maintain the output data value at each pin. When reading, the logic levels of the Port's input pins are returned in the PnIN. If the PnOUT register is read, the value returned will be the value of the output latch, not the logic level of the port pad. The PnIN register is read only. The Port input mode of the I/O pins is defined using the Port Input Mode registers (PnMDI). Each Port cell can be configured for analog or digital I/O. The output driver characteristics of the digital I/O pins are defined using the Port Output Mode registers (PnMDO). Each Port Output driver can be configured as either open drain or push-pull. To configure a pin as a digital input, configure it as an open drain output and write 1 to its port latch. The drive strength of the output drivers are controlled by the Port Drive Strength (PnDRIVE) registers. The default is low drive strength. See Table 3.2 on page 13 for the difference in output drive strength between the two modes.
Rev. 1.0
65
CP2400/1/2/3
SFR Definition 10.4. PnOUT: Port n Output Latch
Bit Name Type Reset 1 1 1 1 7 6 5 4 3 PnOUT[7:0] R/W 1 1 1 1 2 1 0
Address: P0OUT = 0xB0; P1OUT = 0xB1; P2OUT = 0xB2; P3OUT = 0xB3; P4OUT = 0xB4 Bit Name Function 7:0 PnOUT[7:0] Port n Output Latch. Sets or reads the Port latch logic value. 0: Pn.x output latch is logic LOW. 1: Pn.x output latch is logic HIGH.
SFR Definition 10.5. PnIN: Port n Input
Bit Name Type Reset 1 1 1 1 7 6 5 4 PnIN[7:0] R 1 1 1 1 3 2 1 0
Address: P0IN = 0xD1; P1IN = 0xD2; P2IN = 0xD3; P3IN = 0xD4; P4IN = 0xD5 Bit Name Function 7:0 PnIN[7:0] Port n Input. Reads the Port pin logic state in Port cells configured for digital I/O. 0: Pn.x Port pin is logic LOW. 1: Pn.x Port pin is logic HIGH.
66
Rev. 1.0
CP2400/1/2/3
SFR Definition 10.6. PnMDI: Port n Input Mode
Bit Name Type Reset 1 1 1 1 7 6 5 4 P0MDI[7:0] R/W 1 1 1 1 3 2 1 0
Address: P0MDI = 0xB5; P1MDI = 0xB6; P2MDI = 0xB7; P3MDI = 0xB8; P4MDI = 0xB9 Bit Name Function 7:0 PnMDI[7:0] Pn Analog Configuration Bits. Port pins configured for analog mode have their weak pullup, digital driver, and digital receiver disabled. 0: Corresponding Pn.x pin is configured for analog I/O. 1: Corresponding Pn.x pin is configured for digital I/O.
SFR Definition 10.7. PnMDO: Port n Output Mode
Bit Name Type Reset 0 0 0 0 7 6 5 4 3 2 1 0
PnMDO[7:0] R/W 0 0 0 0
Address: P0MDO = 0xBA; P1MDO = 0xBB; P2MDO = 0xBC; P3MDO = 0xBD; P4MDO = 0xBE Bit Name Function 7:0 PnMDO[7:0] Pn Output Configuration Bits. 0: Corresponding Pn.x Output is open-drain. 1: Corresponding Pn.x Output is push-pull.
Rev. 1.0
67
CP2400/1/2/3
SFR Definition 10.8. PnDRIVE: Port n Drive Strength
Bit Name Type Reset 0 0 0 0 7 6 5 4 3 2 1 0
PnDRIVE[7:0] R/W 0 0 0 0
Address: P0DRIVE = 0xBF; P1DRIVE = 0xC0; P2DRIVE = 0xC1; P3DRIVE = 0xC2; P4DRIVE = 0xC3 Bit Name Function 7:0 PnDRIVE[7:0] Pn Drive Strength Configuration Bits. Configures digital I/O Port cells to high or low output drive strength. 0: Corresponding Pn.x has low output drive strength. 1: Corresponding Pn.x has high output drive strength.
68
Rev. 1.0
CP2400/1/2/3
11. SmaRTClock (Real Time Clock)
CP2400/1/2/3 devices include an ultra low power 32-bit SmaRTClock Peripheral (Real Time Clock) with alarm. The SmaRTClock has a dedicated 32 kHz oscillator that can be configured for use with or without a crystal. No external resistor or loading capacitors are required. The on-chip loading capacitors are programmable to 16 discrete levels allowing compatibility with a wide range of crystals. The SmaRTClock allows a maximum of 36 hour 32-bit independent time-keeping when used with a 32.768 kHz Watch Crystal. The SmaRTClock provides an Alarm and Missing SmaRTClock events, which could be used to wake up from the ultra low power mode.
XTAL2 XTAL1
SmaRTClock
Programmable Load Capacitors SmaRTClock Oscillator
32-Bit SmaRTClock Timer Host Interface Interface Registers RTC0KEY RTC0ADR RTC0DAT
SmaRTClock State Machine Interrupt
Internal Registers
CAPTUREn RTC0CN RTC0XCN RTC0XCF ALARMn
Figure 11.1. SmaRTClock Block Diagram
Rev. 1.0
69
CP2400/1/2/3
11.1. SmaRTClock Interface
The SmaRTClock Interface consists of three registers: RTCKEY, RTCADR, and RTCDAT. These interface registers are located on the CP2400/1/2/3 register map and provide access to the SmaRTClock internal registers listed in Table 11.1. The SmaRTClock internal registers can only be accessed indirectly through the SmaRTClock Interface.
Table 11.1. SmaRTClock Internal Registers
SmaRTClock SmaRTClock Address Register 0x00-0x03 0x04 0x05 0x06 CAPTUREn RTC0CN RTC0XCN RTC0XCF Register Name SmaRTClock Capture Registers SmaRTClock Control Register SmaRTClock Oscillator Control Register SmaRTClock Oscillator Configuration Register SmaRTClock Alarm Registers Description Four Registers used for setting the 32-bit SmaRTClock timer or reading its current value. Controls the operation of the SmaRTClock State Machine. Controls the operation of the SmaRTClock Oscillator. Controls the value of the progammable oscillator load capacitance and enables/ disables AutoStep. Four registers used for setting or reading the 32-bit SmaRTClock alarm value.
0x08-0x0B
ALARMn
11.1.1. SmaRTClock Lock and Key Functions
The SmaRTClock Interface is protected with a lock and key function. The SmaRTClock Lock and Key Register (RTCKEY) must be written with the correct key codes, in sequence, before writes and reads to RTCADR and RTCDAT may be performed. The key codes are: 0xA5, 0xF1. There are no timing restrictions, but the key codes must be written in order. If the key codes are written out of order, the wrong codes are written, or an indirect register read or write is attempted while the interface is locked, the SmaRTClock interface will be disabled, and the RTCADR and RTCDAT registers will become inaccessible until the next system reset. Once the SmaRTClock interface is unlocked, software may perform any number of accesses to the SmaRTClock registers until the interface is re-locked or the device is reset. Any write to RTCKEY while the SmaRTClock interface is unlocked will re-lock the interface. Reading the RTCKEY register at any time will provide the SmaRTClock Interface status and will not interfere with the sequence that is being written. The RTCKEY register description in SFR Definition 11.1 lists the definition of each status code.
70
Rev. 1.0
CP2400/1/2/3
11.1.2. Using RTCADR and RTCDAT to Access SmaRTClock Internal Registers
The SmaRTClock internal registers can be read and written using RTCADR and RTCDAT. The RTCADR register selects the SmaRTClock internal register that will be targeted by subsequent reads or writes. A SmaRTClock Write operation is initiated by writing to the RTCDAT register. Below is an example of writing to a SmaRTClock internal register. 1. Write 0x05 to RTCADR. This selects the internal RTC0CN register at SmaRTClock Address 0x05. 2. Write 0x00 to RTCDAT. This operation writes 0x00 to the internal RTC0CN register. A SmaRTClock Read operation is initiated by setting the SmaRTClock Interface Busy bit. This transfers the contents of the internal register selected by RTCADR to RTCDAT. The transferred data will remain in RTCDAT until the next read or write operation. Below is an example of reading a SmaRTClock internal register. 1. Write 0x05 to RTCADR. This selects the internal RTC0CN register at SmaRTClock Address 0x05. 2. Write 1 to BUSY. This initiates the transfer of data from RTC0CN to RTCDAT. Note: Step 1 and Step 2 may be combined into a single write. 3. Read data from RTCDAT. This data is a copy of the RTC0CN register.
11.1.3. SmaRTClock Interface Autoread Feature
When Autoread is enabled, each read from RTCDAT initiates the next indirect read operation on the SmaRTClock internal register selected by RTCADR. Software should set the BUSY bit once at the beginning of each series of consecutive reads. Software must check if the SmaRTClock Interface is busy prior to reading RTCDAT. Autoread is enabled by setting AUTORD (RTCADR.6) to logic 1.
11.1.4. RTCADR Autoincrement Feature
For ease of reading and writing the 32-bit CAPTURE and ALARM values, RTCADR automatically increments after each read or write to a CAPTUREn or ALARMn register. This speeds up the process of setting an alarm or reading the current SmaRTClock timer value by allowing all 4 CAPTURE or ALARM registers to be read or written in a single block write. Autoincrement is always enabled.
Notes: Autoincrement should only be used with block reads/writes. When using single-byte reads/writes, RTCADR must be written before each data read or write.
When using SMBus to perform a block read/write, the RTCADR register must be written using the REGSET command.
Rev. 1.0
71
CP2400/1/2/3
SFR Definition 11.1. RTCKEY: SmaRTClock Lock and Key
Bit Name Type Reset 0 0 0 0 7 6 5 4 3 2 1 0
RTC0ST[7:0] R/W 0 0 0 0
Address = 0x0A Bit Name 7:0 RTC0ST
Function SmaRTClock Interface Lock/Key and Status. Locks/unlocks the SmaRTClock interface when written. Provides lock status when read. Read: 0x00: SmaRTClock Interface is locked. 0x01: SmaRTClock Interface is locked. First key code (0xA5) has been written, waiting for second key code. 0x02: SmaRTClock Interface is unlocked. First and second key codes (0xA5, 0xF1) have been written. 0x03: SmaRTClock Interface is disabled until the next system reset. Write: When RTC0ST = 0x00 (locked), writing 0xA5 followed by 0xF1 unlocks the SmaRTClock Interface. When RTC0ST = 0x01 (waiting for second key code), writing any value other than the second key code (0xF1) will change RTC0STATE to 0x03 and disable the SmaRTClock Interface until the next system reset. When RTC0ST = 0x02 (unlocked), any write to RTCKEY will lock the SmaRTClock Interface. When RTC0ST = 0x03 (disabled), writes to RTCKEY have no effect.
72
Rev. 1.0
CP2400/1/2/3
SFR Definition 11.2. RTCADR: SmaRTClock Address
Bit Name Type Reset 7 BUSY R/W 0 6 AUTORD R/W 0 R 0 5 4 SHORT R/W 0 varies varies 3 2 ADDR[3:0] R/W varies varies 1 0
Address = 0x0B Bit Name 7 6 BUSY
Function SmaRTClock Interface Busy Indicator. Indicates SmaRTClock interface status. Writing 1 to this bit initiates an indirect read.
AUTORD SmaRTClock Interface Autoread Enable. Enables/disables Autoread. 0: Autoread Disabled. 1: Autoread Enabled. Unused SHORT Read = 0b; Write = Don't Care. Short Strobe Enable. Enables/disables the Short Strobe Feature. It is recommended to always enable the short strobe feature to minimize the read/write time. 0: Short Strobe disabled. 1: Short Strobe enabled.
5 4
3:0
ADDR[3:0] SmaRTClock Indirect Register Address. Sets the currently selected SmaRTClock register. See Table 11.1 for a listing of all SmaRTClock indirect registers.
Note: The ADDR bits increment after each indirect read/write operation that targets a CAPTUREn or ALARMn internal SmaRTClock register. Autoincrement should only be used with block reads/writes.
SFR Definition 11.3. RTCDAT: SmaRTClock Data
Bit Name Type Reset 0 0 0 0 7 6 5 4 3 2 1 0
RTCDAT[7:0] R/W 0 0 0 0
Address = 0x0C Bit Name 7:0 RTCDAT
Function SmaRTClock Data Bits. Holds data transferred to/from the internal SmaRTClock register selected by RTCADR.
Rev. 1.0
73
CP2400/1/2/3
11.2. SmaRTClock Clocking Sources
The SmaRTClock peripheral is clocked from its own timebase, independent of the system clock. The SmaRTClock timebase is derived from the SmaRTClock oscillator circuit, which has two modes of operation: crystal mode, and self-oscillate mode. The oscillation frequency is 32.768 kHz in crystal mode and can be programmed in the range of sub 20 kHz to above 40 kHz in self-oscillate mode. In crystal mode, XTAL1 and XTAL2 may be overdriven by an external CMOS clock.
11.2.1. Using the SmaRTClock Oscillator with a Crystal or External CMOS Clock
When using crystal mode, a 32.768 kHz crystal should be connected between XTAL3 and XTAL4. No other external components are required. The following steps show how to start the SmaRTClock crystal oscillator in software: 1. Set SmaRTClock to Crystal Mode (XMODE = 1). 2. Optional. Enable/Disable Automatic Gain Control (AGCEN) and Bias Doubling (BIASX2). See Section 11.2.4 for recommendations on using these oscillator features. 3. Set the desired loading capacitance (RTC0XCF). 4. Enable power to the SmaRTClock oscillator circuit (RTC0EN = 1). 5. Wait 2 ms. 6. Poll the SmaRTClock Clock Valid Bit (CLKVLD) until the crystal oscillator stabilizes. 7. Poll the SmaRTClock Load Capacitance Ready Bit (LOADRDY) until the load capacitance reaches its programmed value. 8. Enable the SmaRTClock missing clock detector. 9. Wait 2 ms. 10.Clear the PMU0CF wake-up source flags. In crystal mode, the SmaRTClock oscillator may be driven by an external CMOS clock. The CMOS clock should be applied to both XTAL1 and XTAL2. The input low voltage (VIL) and input high voltage (VIH) for these pins when used with an external CMOS clock are 0.1 and 0.8 V, respectively. The SmaRTClock oscillator should be configured to its lowest bias setting with AGC disabled. The CLKVLD bit is indeterminate when using a CMOS clock, however, the OSCFAIL bit may be checked 2 ms after SmaRTClock oscillator is powered on to ensure that there is a valid clock.
11.2.2. Using the SmaRTClock Oscillator in Self-Oscillate Mode
The following steps show how to configure SmaRTClock for use in self-oscillate mode: 1. Set SmaRTClock to Self-Oscillate Mode (XMODE = 0). 2. Set the desired oscillation frequency: For oscillation at about 20 kHz, set BIASX2 = 0. For oscillation at about 40 kHz, set BIASX2 = 1. 3. The oscillator starts oscillating instantaneously. 4. Fine tune the oscillation frequency by adjusting the load capacitance (RTC0XCF).
74
Rev. 1.0
CP2400/1/2/3
11.2.3. Programmable Load Capacitance
The programmable load capacitance has 16 values to support crystal oscillators with a wide range of recommended load capacitance. If Automatic Load Capacitance Stepping is enabled, the crystal load capacitors start at the smallest setting to allow a fast startup time, then slowly increase the capacitance until the final programmed value is reached. The final programmed loading capacitor value is specified using the LOADCAP bits in the RTC0XCF register. The LOADCAP setting specifies the amount of on-chip load capacitance and does not include any stray PCB capacitance. Once the final programmed loading capacitor value is reached, the LOADRDY flag will be set by hardware to logic 1. When using the SmaRTClock oscillator in self-oscillate mode, the programmable load capacitance can be used to fine tune the oscillation frequency. In most cases, increasing the load capacitor value will result in a decrease in oscillation frequency. .Table 11.2 shows the crystal load capacitance for various settings of LOADCAP.
Table 11.2. SmaRTClock Load Capacitance Settings
LOADCAP 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Crystal Load Capacitance 4.0 pF 4.5 pF 5.0 pF 5.5 pF 6.0 pF 6.5 pF 7.0 pF 7.5 pF 8.0 pF 8.5 pF 9.0 pF 9.5 pF 10.5 pF 11.5 pF 12.5 pF 13.5 pF Equivalent Capacitance seen on XTAL1 and XTAL2 8.0 pF 9.0 pF 10.0 pF 11.0 pF 12.0 pF 13.0 pF 14.0 pF 15.0 pF 16.0 pF 17.0 pF 18.0 pF 19.0 pF 21.0 pF 23.0 pF 25.0 pF 27.0 pF
Rev. 1.0
75
CP2400/1/2/3
11.2.4. Automatic Gain Control and SmaRTClock Bias Doubling
Automatic Gain Control allows the SmaRTClock oscillator to trim the oscillation amplitude of a crystal in order to achieve the lowest possible power consumption. Automatic Gain Control automatically detects when the oscillation amplitude has reached a point where it safe to reduce the drive current, therefore, it may be enabled during crystal startup. It is recommended to enable Automatic Gain Control in any system which uses the SmaRTClock oscillator in crystal mode. Turning off Automatic Gain Control will allow the crystal drive strength after oscillation is started to remain at the same level used for starting the crystal. This will result in increased power consumption, however the crystal will have higher immunity against external factors.
Note: Automatic Gain Control may be turned on in self-oscillate mode to reduce the oscillation frequency and the supply current.
The SmaRTClock Bias Doubling feature allows the self-oscillation frequency to be increased (almost doubled) and allows a higher crystal drive strength in crystal mode. High crystal drive strength is recommended when using a crystal with a high ESR and high loading capacitance. Table 11.3 shows a summary of the oscillator operating modes and allowed operating conditions. SmaRTClock Bias Doubling is enabled by setting BIASX2 (RTC0XCN.5) to 1.
Table 11.3. SmaRTClock Bias Settings and Allowed Operating Conditions
Mode Crystal Setting Bias Double Off, AGC On Power Consumption Lowest Allowed Operating Condition ESR < 40 k, any load ESR < 50 k, Cload < 10 pF ESR < 80 k, Cload < 8 pF ESR < 80 k, Cload < 10 pF ESR < 50 k, any load ESR < 80 k, Cload < 10 pF This mode is only recommended for debugging purposes due to its increased power consumption. 20 kHz 40 kHz
Bias Double Off, AGC Off Bias Double On, AGC On Bias Double On, AGC Off
Low High Highest
Self-Oscillate
Bias Double Off Bias Double On
Low High
76
Rev. 1.0
CP2400/1/2/3
11.2.5. Missing SmaRTClock Detector
The missing SmaRTClock detector is a one-shot circuit enabled by setting MCLKEN (RTC0CN.6) to 1. When the SmaRTClock Missing Clock Detector is enabled, OSCFAIL (RTC0CN.5) is set by hardware if SmaRTClock oscillator remains high or low for more than 100 s. A SmaRTClock Missing Clock detector timeout can trigger an interrupt and wake the device from a low power mode. See Section "7. Interrupt Sources" on page 40 and Section "9. Power Modes" on page 49, and for more information.
Note: The SmaRTClock Missing Clock Detector should be disabled when making changes to the oscillator settings in RTC0XCN.
11.2.6. SmaRTClock Oscillator Crystal Valid Detector
The SmaRTClock oscillator crystal valid detector is an oscillation amplitude detector circuit used during crystal startup to determine when oscillation has started and is nearly stable. The output of this detector can be read from the CLKVLD bit (RTX0XCN.4).
Notes:The CLKVLD bit has a blanking interval of 2 ms. During the first 2 ms after turning on the crystal oscillator, the output of CLKVLD is not valid.
This SmaRTClock crystal valid detector (CLKVLD) is not intended for detecting an oscillator failure. The missing SmaRTClock detector (CLKFAIL) should be used for this purpose.
11.3. SmaRTClock Timer and Alarm Function
The SmaRTClock timer is a 32-bit counter that, when running (RTC0TR = 1), is incremented every SmaRTClock oscillator cycle. The timer has an alarm function that can be set to generate an interrupt and wake the device from a low power mode. See Section "7. Interrupt Sources" on page 40 and Section "9. Power Modes" on page 49 more information. The SmaRTClock timer includes an Auto Reset feature, which automatically resets the timer to zero one SmaRTClock cycle after an alarm occurs. When using Auto Reset, the Alarm match value should always be set to 1 count less than the desired match value. Auto Reset can be enabled by writing a 1 to ALRM (RTC0CN.2).
11.3.1. Setting and Reading the SmaRTClock Timer Value
The 32-bit SmaRTClock timer can be set or read using the six CAPTUREn internal registers. Note that the timer does not need to be stopped before reading or setting its value. The following steps can be used to set the timer value: 1. Write the desired 32-bit set value to the CAPTUREn registers. 2. Write 1 to RTC0SET. This will transfer the contents of the CAPTUREn registers to the SmaRTClock timer. 3. Operation is complete when RTC0SET is cleared to 0 by hardware. The following steps can be used to read the current timer value: 1. Write 1 to RTC0CAP. This will transfer the contents of the timer to the CAPTUREn registers. 2. Poll RTC0CAP until it is cleared to 0 by hardware. 3. A snapshot of the timer value can be read from the CAPTUREn registers
11.3.2. Setting a SmaRTClock Alarm
The SmaRTClock alarm function compares the 32-bit value of SmaRTClock Timer to the value of the ALARMn registers. An alarm event is triggered if the SmaRTClock timer is equal to the ALARMn registers. If Auto Reset is enabled, the 32-bit timer will be cleared to zero one SmaRTClock cycle after the alarm event. The SmaRTClock alarm event can be configured to generate a wake-up from a low power mode, or generate an interrupt. See Section "7. Interrupt Sources" on page 40, Section "9. Power Modes" on page 49, and for more information. The following steps can be used to set up a SmaRTClock Alarm:
Rev. 1.0
77
CP2400/1/2/3
1. Disable SmaRTClock Alarm Events (RTC0AEN = 0). 2. Set the ALARMn registers to the desired value. 3. Enable SmaRTClock Alarm Events (RTC0AEN = 1).
Notes:The ALRM bit, which is used as the SmaRTClock Alarm Event flag, is cleared by disabling SmaRTClock Alarm Events (RTC0AEN = 0).
Disabling (RTC0AEN = 0) then re-enabling Alarm Events (RTC0AEN = 1) after a SmaRTClock Alarm without modifying ALARMn registers will automatically schedule the next alarm after 2^32 SmaRTClock cycles (approximately 36 hours using a 32.768 kHz crystal). The SmaRTClock Alarm Event flag will remain asserted for a maximum of one SmaRTClock cycle. The Alarm Event however will be captured by the interrupt logic and will post a non-transient interrupt.
11.3.3. Software Considerations for using the SmaRTClock Timer and Alarm
The SmaRTClock timer and alarm have two operating modes to suit varying applications. The two modes are described below: Mode 1: The first mode uses the SmaRTClock timer as a perpetual timebase which is never reset to zero. Every 36 hours, the timer is allowed to overflow without being stopped or disrupted. The alarm interval is software managed and is added to the ALRMn registers by software after each alarm. This allows the alarm match value to always stay ahead of the timer by one software managed interval. If software uses 32-bit unsigned addition to increment the alarm match value, then it does not need to handle overflows since both the timer and the alarm match value will overflow in the same manner. This mode is ideal for applications which have a long alarm interval (e.g., 24 or 36 hours) and/or have a need for a perpetual timebase. An example of an application that needs a perpetual timebase is one whose wake-up interval is constantly changing. For these applications, software can keep track of the number of timer overflows in a 16-bit variable, extending the 32-bit (36 hour) timer to a 48-bit (272 year) perpetual timebase. Mode 2: The second mode uses the SmaRTClock timer as a general purpose up counter which is auto reset to zero by hardware after each alarm. The alarm interval is managed by hardware and stored in the ALRMn registers. Software only needs to set the alarm interval once during device initialization. After each alarm, software should keep a count of the number of alarms that have occurred in order to keep track of time. This mode is ideal for applications that require minimal software intervention and/or have a fixed alarm interval. This mode is the most power efficient since it requires less CPU time per alarm.
78
Rev. 1.0
CP2400/1/2/3
Internal Register Definition 11.4. RTC0CN: SmaRTClock Control
Bit Name Type Reset 7 RTC0EN R/W 0 6 MCLKEN R/W 0 5 OSCFAIL R/W Varies 4 RTC0TR R/W 0 3 RTC0AEN R/W 0 Function 2 ALRM R/W 0 1 RTC0SET R/W 0 0 RTC0CAP R/W 0
SmaRTClock Address = 0x04 Bit Name 7 RTC0EN
SmaRTClock Enable. Enables/disables the SmaRTClock oscillator and associated bias currents. 0: SmaRTClock oscillator disabled. 1: SmaRTClock oscillator enabled.
6
MCLKEN Missing SmaRTClock Detector Enable. Enables/disables the missing SmaRTClock detector. 0: Missing SmaRTClock detector disabled. 1: Missing SmaRTClock detector enabled. OSCFAIL SmaRTClock Oscillator Fail Event Flag. Set by hardware when a missing SmaRTClock detector timeout occurs. Must be cleared by software. The value of this bit is not defined when the SmaRTClock oscillator is disabled. RTC0TR SmaRTClock Timer Run Control. Controls if the SmaRTClock timer is running or stopped (holds current value). 0: SmaRTClock timer is stopped. 1: SmaRTClock timer is running.
5
4
3
RTC0AEN SmaRTClock Alarm Enable. Enables/disables the SmaRTClock alarm function. Also clears the ALRM flag. 0: SmaRTClock alarm disabled. 1: SmaRTClock alarm enabled. ALRM SmaRTClock Alarm Event Flag and Auto Reset Enable Reads return the state of the alarm event flag. Writes enable/disable the Auto Reset function. Read: 0: SmaRTClock alarm event flag is de-asserted. 1: SmaRTClock alarm event flag is asserted. Write: 0: Disable Auto Reset. 1: Enable Auto Reset.
2
1
RTC0SET SmaRTClock Timer Set. Writing 1 initiates a SmaRTClock timer set operation. This bit is cleared to 0 by hardware to indicate that the timer set operation is complete. RTC0CAP SmaRTClock Timer Capture. Writing 1 initiates a SmaRTClock timer capture operation. This bit is cleared to 0 by hardware to indicate that the timer capture operation is complete.
0
Note: The ALRM flag will remain asserted for a maximum of one SmaRTClock cycle.
Rev. 1.0
79
CP2400/1/2/3
Internal Register Definition 11.5. RTC0XCN: SmaRTClock Oscillator Control
Bit Name Type Reset 7 AGCEN R/W 0 6 XMODE R/W 0 5 BIASX2 R/W 0 4 CLKVLD R 0 R 0 R 0 R 0 R 0 3 2 1 0
SmaRTClock Address = 0x05 Bit Name 7 AGCEN
Function
SmaRTClock Oscillator Automatic Gain Control (AGC) Enable. 0: AGC disabled. 1: AGC enabled. SmaRTClock Oscillator Mode. Selects Crystal or Self Oscillate Mode. 0: Self-Oscillate Mode selected. 1: Crystal Mode selected. SmaRTClock Oscillator Bias Double Enable. Enables/disables the Bias Double feature. 0: Bias Double disabled. 1: Bias Double enabled. SmaRTClock Oscillator Crystal Valid Indicator. Indicates if oscillation amplitude is sufficient for maintaining oscillation. 0: Oscillation has not started or oscillation amplitude is too low to maintain oscillation. 1: Sufficient oscillation amplitude detected. Read = 0000b; Write = Don't Care.
6
XMODE
5
BIASX2
4
CLKVLD
3:0
Unused
80
Rev. 1.0
CP2400/1/2/3
Internal Register Definition 11.6. RTC0XCF: SmaRTClock Oscillator Configuration
Bit Name Type Reset 7 AUTOSTP R/W 0 6 LOADRDY R 0 R 0 R 0 0 0 5 4 3 2 LOADCAP R/W 0 0 1 0
SmaRTClock Address = 0x06 Bit Name 7 AUTOSTP
Function
Automatic Load Capacitance Stepping Enable. Enables/disables automatic load capacitance stepping. 0: Load capacitance stepping disabled. 1: Load capacitance stepping enabled. Load Capacitance Ready Indicator. Set by hardware when the load capacitance matches the programmed value. 0: Load capacitance is currently stepping. 1: Load capacitance has reached it programmed value. Read = 00b; Write = Don't Care. Load Capacitance Programmed Value. Holds the user's desired value of the load capacitance. See Table 11.2 on page 75.
6
LOADRDY
5:4 3:0
Unused LOADCAP
Rev. 1.0
81
CP2400/1/2/3
Internal Register Definition 11.7. CAPTUREn: SmaRTClock Timer Capture
Bit Name Type Reset R/W 0 R/W 0 R/W 0 7 6 5 4 3 2 1 0
CAPTURE[31:0] R/W 0 R/W 0 R/W 0 R/W 0 R/W 0
SmaRTClock AddressCAPTURE0 = 0x00; CAPTURE1 = 0x01; CAPTURE2 =0x02; CAPTURE3: 0x03. Bit Name Function 7:0 CAPTURE[31:0] SmaRTClock Timer Capture. These 4 registers (CAPTURE3-CAPTURE0) are used to read or set the 32-bit SmaRTClock timer. Data is transferred to or from the SmaRTClock timer when the RTC0SET or RTC0CAP bits are set.
Note: The least significant bit of the timer capture value is in CAPTURE0.0.
Internal Register Definition 11.8. ALARMn: SmaRTClock Alarm Programmed Value
Bit Name Type Reset R/W 0 R/W 0 R/W 0 7 6 5 4 3 2 1 0
ALARM[31:0] R/W 0 R/W 0 R/W 0 R/W 0 R/W 0
SmaRTClock AddressALARM0 = 0x08; ALARM1 = 0x09; ALARM2 = 0x0A; ALARM3 = 0x0B Bit Name Function 7:0 ALARM[31:0] SmaRTClock Alarm Programmed Value. These 4 registers (ALARM3-ALARM0) are used to set an alarm event for the SmaRTClock timer. The SmaRTClock alarm should be disabled (RTC0AEN=0) when updating these registers.
Note: The least significant bit of the alarm programmed value is in ALARM0.0.
82
Rev. 1.0
CP2400/1/2/3
12. LCD Segment Driver
CP2400/1/2/3 devices contain an LCD segment driver and on-chip bias generation that supports static, 2-mux, 3mux and 4-mux LCDs with 1/2 or 1/3 bias. The on-chip charge pump with programmable output voltage allows software contrast control which is independent of the VDD supply voltage. LCD timing is derived from the SmaRTClock oscillator to allow precise control over the refresh rate. A low frequency clock present on the CLK pin may also be used as the LCD clock source. The CP2400/1/2/3 contains on-chip ULP memory to store the enabled/disabled state of individual LCD segments. All LCD waveforms are generated on-chip and software only needs to access the ULP memory to change the information displayed on the LCD. An LCD blinking function is also supported. A block diagram of the LCD segment driver is shown in Figure 12.1.
10 uF
VDD
CAP
CPBYP
LCD Segment Driver
Charge Pump
Bias Generator
RTCBYP
XTAL1 XTAL2 CLK
SmaRTClock LCD State Machine
Segment Pins Port Drivers
Configuration Registers
ULP Memory
4 COM Pins
Figure 12.1. LCD Segment Driver Block Diagram
12.1. Initializing the LCD Segment Driver
The following procedure is recommended for using the LCD Segment Driver: 1. 2. 3. 4. 5. 6. 7. 8. 9. Configure the LCD size, mux mode, and bias using the LCD0CN register. Configure the Port I/O pins to be used for LCD as Analog I/O. Set the LCD contrast using the CONTRAST register. Write the reserved value of 0x9F to LCD0CF. Set the LCD refresh rate using the LCD0DIVH:LCD0DIVL registers. Set the LCD toggle rate using the LCD0TOGR register. Set the LCD power mode using the LCD0PWR register. Write a pattern to the ULP memory. Enable the LCD using the master control (MSCN) register.
Rev. 1.0
83
CP2400/1/2/3
12.2. LCD Configuration
The LCD segment driver supports multiple mux options: static, 2-mux, 3-mux, and 4-mux mode. It also supports 1/2 and 1/3 bias options. The desired mux mode and bias is configured through the LCD0CN register.
SFR Definition 12.1. LCD0CN: LCD0 Control Register
Bit Name Type Reset R/W 0 R/W 0 R/W 0 7 6 5 4 BLANK R/W 0 3 SIZE R/W 0 0 2 MUXMD R/W 0 1 0 BIAS R/W 0
Address = 0x95
Bit Name Function
7:5 4
Unused BLANK
Read = 000. Write = Don't Care.
Blank All Segments.
Blanks all LCD segments using a single bit. 0: All LCD segments are controlled by the LCD memory. 1: All LCD segments are blank (turned off).
3
SIZE
LCD Size Select.
Selects whether 16 or 32 segment pins will be used for the LCD function. 0: P0 and P1 are used as LCD segment pins. 1: P0, P1, P2, and P3 are used as LCD segment pins.
2:1
MUXMD[1:0] LCD Bias Power Mode. Selects the mux mode. 00: Static mode selected. 01: 2-mux mode selected. 10: 3-mux mode selected. 11: 4-mux mode selected. BIAS
Bias Select.
0
Selects between 1/2 Bias and 1/3 Bias.
0: LCD0 is configured for 1/3 Bias. 1: LCD0 is configured for 1/2 Bias.
84
Rev. 1.0
CP2400/1/2/3
12.3. LCD Bias Generation and Contrast Adjustment
The LCD Bias voltages are generated using the on-chip charge pump with programmable output voltage. The programmable output voltage allows software contrast control in 60 mV steps from 2.6 to 3.44 V. The LCD contrast is controlled by the CONTRAST register.
Note: An external 4.7 F decoupling capacitor is required (10 F recommended) on the CAP pin to create a charge reservoir at the output of the charge pump.
Intermediate voltages used for 1/2 and 3/4 bias configurations are generated on-chip using a novel approach that allows driving extra large LCD segments while maintaining ultra low power consumption. This eliminates the need for off-chip biasing when driving a large LCD. The LCD drive capability can be set using the LCD0PWR register. The highest power setting should be used for extra large LCDs (which require charging the largest capacitance) and the lowest power setting should be used with small LCDs (smaller than 1 inch).
SFR Definition 12.2. CONTRAST: Contrast Adjustment
Bit Name Type Reset R/W 0 R/W 0 R/W 0 R/W 0 0 0 7 6 5 4 3 2 CNTRST R/W 0 0 1 0
Address = 0x96
Bit Name Function
7:4 3:0
Unused
Read = 0000. Write = Don't Care.
CNTRST Contrast Adjustment. Selects the on-chip charge pump output voltage. 0000: 2.60 V 0001: 2.60 V 0010: 2.66 V 0011: 2.72 V 0100: 2.78 V 0101: 2.84 V 0110: 2.90 V 0111: 2.96 V 1000: 3.02 V 1001: 3.08 V 1010: 3.14 V 1011: 3.20 V 1100: 3.26 V 1101: 3.32 V 1110: 3.38 V 1111: 3.44 V
Rev. 1.0
85
CP2400/1/2/3
SFR Definition 12.3. LCD0CF: LCD Configuration
Bit Name Type Reset 1 7 Reserved R/W 0 0 1 1 6 5 4 3 2 1 0
CPCYC[5:0] R/W 1 1 1
Address = 0x97
Bit Name Function
7:4 5:0
Reserved
Read = 10b. Must Write 10b. The number of SmaRTClock oscillator periods between charge pump cycles is CPCYC[5:0]+1. The time between charge pump cycles should not exceed 2 ms.
CPCYC[5:0] Charge Pump Cycle Period.
86
Rev. 1.0
CP2400/1/2/3
12.4. LCD Timing Generation
All LCD timing is derived from the SmaRTClock oscillator divided by 2. The LCD0DIVH:LCD0DIVL registers store the prescaler for generating the LCD refresh rate. The LCD mux mode must be taken into account when determining the prescaler value. See the LCD0DIVH/LCD0DIVL register descriptions for more details. For maximum power savings, choose a slow LCD refresh rate. For the least flicker, choose a fast LCD refresh rate.
SFR Definition 12.4. LCD0DIVH: LCD Refresh Rate Prescaler High Byte
Bit Name Type Reset R/W 0 R/W 0 R/W 0 R/W 0 R/W 0 R/W 0 0 7 6 5 4 3 2 1 0
LCD0DIV[9:8] R/W 0
Address = 0x98
Bit Name Function
7:2 1:0
Unused
Read = 000000. Write = Don't Care.
LCD0DIV[9:8] LCD Refresh Rate Prescaler. Sets the LCD refresh rate according to the following equation:
------------------------------------------------------------------------------------------LCD Refresh Rate = SmaRTClock Oscillator Frequency 4 mux_mode LCD0DIV + 1
SFR Definition 12.5. LCD0DIVL: LCD Refresh Rate Prescaler Low Byte
Bit Name Type Reset 0 0 0 0 7 6 5 4 3 2 1 0
LCD0DIV[7:0] R/W 0 0 0 0
Address = 0x99
Bit Name Function
7:0
LCD0DIV[7:0] LCD Refresh Rate Prescaler. Sets the LCD refresh rate according to the following equation:
------------------------------------------------------------------------------------------LCD Refresh Rate = SmaRTClock Oscillator Frequency 4 mux_mode LCD0DIV + 1
Rev. 1.0
87
CP2400/1/2/3
SFR Definition 12.6. LCD0TOGR: LCD Toggle Rate
Bit Name Type Reset R/W 0 R/W 0 R/W 0 R/W 0 0 0 7 6 5 4 3 2 TOGR[3:0] R/W 0 0 1 0
Address = 0x9A
Bit Name Function
7:4 3:0
Unused TOGR[3:0]
Read = 0000. Write = Don't Care.
LCD Toggle Rate Divider.
Sets the LCD Toggle Rate according to the following equation:
Refresh Rate mux_mode 2 LCD Toggle Rate = -------------------------------------------------------------------------------Toggle Rate Divider
0000: Reserved. 0001: Reserved. 0010: Toggle Rate Divider is set to divide by 2. 0011: Toggle Rate Divider is set to divide by 4. 0100: Toggle Rate Divider is set to divide by 8. 0101: Toggle Rate Divider is set to divide by 16. 0110: Toggle Rate Divider is set to divide by 32. 0111: Toggle Rate Divider is set to divide by 64. 1000: Toggle Rate Divider is set to divide by 128. 1001: Toggle Rate Divider is set to divide by 256. 1010: Toggle Rate Divider is set to divide by 512. 1011: Toggle Rate Divider is set to divide by 1024. 1100: Toggle Rate Divider is set to divide by 2048. 1101: Toggle Rate Divider is set to divide by 4096. All other values reserved.
88
Rev. 1.0
CP2400/1/2/3
SFR Definition 12.7. LCD0PWR: LCD0 Power Register
Bit Name Type Reset R/W 0 R/W 0 R/W 0 7 6 5 4 3 2 1 0
CPCLK[1:0] R/W 0 R/W 0 R/W 0 R/W 0 R/W 0
Address = 0x9B
Bit Name Function
7:5 4:3
Reserved
Read = 000b. Must Write 000b.
CPCLK[1:0] Charge Pump Clock Select. 00: 1 MHz charge pump clock (normal operation). 01: 2 MHz charge pump clock. 10: 0.5 MHz charge pump clock. 11: 0.67 MHz charge pump clock. Reserved Read = 000b. Must Write 000b.
2:0
Rev. 1.0
89
CP2400/1/2/3
12.5. Mapping ULP Memory to LCD Pins
The ULP memory is organized in 16 bytes (32 half-bytes or nibbles), each nibble controlling 1 LCD output pin. Each LCD output pin can control 1 to 4 LCD segments depending on the selected mux mode. The least significant bit of each nibble controls the segment connected to the backplane signal COM0 and the most significant bit of each nibble controls the segment connected to the backplane signal COM3. In static mode, only COM0 is used and the three remaining bits in each nibble are ignored. In 4-mux mode, each bit controls an LCD segment. Bits with a value of 1 turn on the associated segment and bits with a value of 0 turn off the associated segment.
B it:
7
6
5
4
3
2
1
0 U LP M E M 15 (P ins: LC D 31, LC D 30) U LP M E M 14 (P ins: LC D 29, LC D 28) U LP M E M 13 (P ins: LC D 27, LC D 26) U LP M E M 12 (P ins: LC D 25, LC D 24) U LP M E M 11 (P ins: LC D 23, LC D 22) U LP M E M 10 (P ins: LC D 21, LC D 20) U LP M E M 09 (P ins: LC D 19, LC D 18) U LP M E M 08 (P ins: LC D 17, LC D 16) U LP M E M 07 (P ins: LC D 15, LC D 14) U LP M E M 06 (P ins: LC D 13, LC D 12) U LP M E M 05 (P ins: LC D 11, LC D 10) U LP M E M 04 (P ins: LC D 9, LC D 8) U LP M E M 03 (P ins: LC D 7, LC D 6) U LP M E M 02 (P ins: LC D 5, LC D 4) U LP M E M 01 (P ins: LC D 3, LC D 2) U LP M E M 00 (P ins: LC D 1, LC D 0)
COM3
COM2
COM1
COM0
COM3
COM2
COM1
Figure 12.2. ULP Memory Map
90
Rev. 1.0
COM0
CP2400/1/2/3
12.6. Blinking LCD Segments
The LCD driver supports blinking LCD applications such as clock applications where the "colon" separator toggles on and off once per second. If the LCD is only displaying the hours and minutes, then the device only needs to wake up once per minute to update the display. The once per second blinking is automatically handled by the CP2400/1/2/3. The LCD0BLINK register can be used to enable blinking on any LCD segment connected to the LCD0 or LCD1 segment pin. In static mode, a maximum of 2 segments can blink. In 4-mux mode, a maximum of 8 segments can blink. The LCD0BLINK mask register targets the same LCD segments as the ULPMEM00 register. If an LCD0BLINK bit corresponding to an LCD segment is set to 1, then that segment will toggle at the frequency set by the LCD0TOGR register without any software intervention.
SFR Definition 12.8. LCD0BLINK: LCD0 Blink Mask
Bit Name Type Reset R/W 0 R/W 0 R/W 0 7 6 5 4 3 2 1 0
LCD0BLINK[7:0] R/W 0 R/W 0 R/W 0 R/W 0 R/W 0
Address = 0x80
Bit Name Function
7:0
LCD0BLINK[7:0] LCD0 Blink Mask. Each bit maps to a specific LCD segment connected to the LCD0 and LCD1 segment pins. A value of 1 indicates that the segment is blinking. A value of 0 indicates that the segment is not blinking. This bit to segment mapping is the same as the ULPMEM00 register.
Rev. 1.0
91
CP2400/1/2/3
13. Timers
CP2400/1/2/3 devices include two 16-bit auto-reload timers. These timers can be used to measure time intervals and generate periodic interrupt requests. Both timers can be clocked from the system clock source divided by 12. Timer 1 has an additional SmaRTClock divided by 8 input and capture mode that can be used to measure the SmaRTClock oscillation frequency with respect to the system clock. When SMBus SCL low timeout is enabled, Timer 0 becomes unavailable for general purpose use. Timer 0 is enabled on reset.
13.1. Timer 0
Timer 0 is a 16-bit timer formed by two 8-bit SFRs: TMR0L (low byte) and TMR0H (high byte). Timer 0 operates in 16-bit auto-reload mode and is clocked by the system clock divided by 12. As the 16-bit timer register increments and overflows from 0xFFFF to 0x0000, the 16-bit value in the Timer 0 reload registers (TMR0RLH and TMR0RLL) is loaded into the Timer 0 register as shown in Figure 13.1, and the Timer 0 Overflow Flag (INT1.2) is set. If Timer 0 interrupts are enabled (if INT1EN.2 is set), an interrupt will be generated on each Timer 0 overflow. Additionally, if Timer 0 interrupts are enabled and the TF0LEN bit is set (TMR0CN.5), an interrupt will be generated each time the lower 8 bits (TMR0L) overflow from 0xFF to 0x00.
Lo w B yte O verflo w
T o S M B us
TR0
S Y S C LK / 12
T M R 0L
T M R 0H
T o Interrup t
T M R 0R LL
T M R 0R L H
R e loa d
Figure 13.1. Timer 0 Block Diagram
92
Rev. 1.0
CP2400/1/2/3
SFR Definition 13.1. TMR0CN: Timer 0 Control
Bit Name Type Reset R/W 0 R/W 0 7 6 5 TF0LEN R/W 0 R/W 0 R/W 0 4 3 2 TR0 R/W 1 R/W 0 R/W 0 1 0
SFR Address = 0x54 Bit Name 7:6 5 Unused TF0LEN Read = 00b. Write = Don't Care. Timer 0 Low Byte Interrupt Enable.
Function
When set to 1, this bit enables Timer 0 Low Byte interrupts. If Timer 0 interrupts are enabled, an interrupt will be generated when the low byte of Timer 0 overflows. 4:3 2 1:0 Unused TR0 Unused Read = 00b. Write = Don't Care. Timer 0 Run Control. Timer 0 is enabled by setting this bit to 1. Read = 00b. Write = Don't Care.
Rev. 1.0
93
CP2400/1/2/3
SFR Definition 13.2. TMR0RLL: Timer 0 Reload Register Low Byte
Bit Name Type Reset 1 0 0 0 7 6 5 4 3 2 1 0
TMR0RLL[7:0] R/W 1 1 0 1
SFR Address = 0x50 Bit Name 7:0 TMR0RLL[7:0] Timer 0 Reload Register Low Byte.
Function TMR0RLL holds the low byte of the reload value for Timer 0.
SFR Definition 13.3. TMR0RLH: Timer 0 Reload Register High Byte
Bit Name Type Reset 0 0 1 1 7 6 5 4 3 2 1 0
TMR0RLH[7:0] R/W 0 1 0 0
SFR Address = 0x51 Bit Name 7:0 TMR0RLH[7:0] Timer 0 Reload Register High Byte.
Function TMR0RLH holds the high byte of the reload value for Timer 0.
94
Rev. 1.0
CP2400/1/2/3
SFR Definition 13.4. TMR0L: Timer 0 Low Byte
Bit Name Type Reset 0 0 0 0 7 6 5 4 TMR0L[7:0] R/W 0 0 0 0 3 2 1 0
SFR Address = 0x52 Bit Name 7:0 TMR0L[7:0] Timer 0 Low Byte.
Function
Contains the low byte of the 16-bit Timer 0.
SFR Definition 13.5. TMR0H Timer 0 High Byte
Bit Name Type Reset 0 0 0 0 7 6 5 4 3 2 1 0
TMR0H[7:0] R/W 0 0 0 0
SFR Address = 0x53 Bit Name 7:0 TMR0H[7:0] Timer 0 High Byte.
Function
Contains the high byte of the 16-bit Timer 0.
Rev. 1.0
95
CP2400/1/2/3
13.2. Timer 1
Timer 1 is a 16-bit timer formed by two 8-bit SFRs: TMR1L (low byte) and TMR1H (high byte). Timer 1 operates in 16-bit auto-reload mode and is clocked by the system clock divided by 12 or SmaRTClock divided by 8. As the 16bit timer register increments and overflows from 0xFFFF to 0x0000, the 16-bit value in the Timer 1 reload registers (TMR1RLH and TMR1RLL) is loaded into the Timer 1 register as shown in Figure 13.1, and the Timer 1 Overflow Flag (INT1.3) is set. If Timer 1 interrupts are enabled (if IN1EN.3 is set), an interrupt will be generated on each Timer 1 overflow. Additionally, if Timer 1 interrupts are enabled and the TF0LEN bit is set (TMR0CN.5), an interrupt will be generated each time the lower 8 bits (TMR0L) overflow from 0xFF to 0x00.
T1XCLK
Low Byte Overflow
To CS0
SYSCLK / 12
0
TR1
TMR1L
TMR1H
To Interrupt
SmaRTClock / 8
1
TMR1RLL TMR1RLH
Reload
Figure 13.2. Timer 1 Block Diagram
96
Rev. 1.0
CP2400/1/2/3
13.2.1. Timer 1 SmaRTClock Oscillator Capture Mode
The Capture Mode in Timer 1 allows the SmaRTClock oscillator period to be measured against the system clock d by 12. Setting TF1CEN to 1 enables the SmaRTClock Oscillator Capture Mode for Timer 1. When Capture Mode is enabled, a capture event will be generated every 8 SmaRTClock oscillator cycles. When the capture event occurs, the contents of Timer 1 (TMR1H:TMR1L) are loaded into the Timer 1 reload registers (TMR3RLH:TMR3RLL) and the T1F interrupt flag is set (triggering an interrupt if Timer 1 interrupts are enabled). By recording the difference between two successive timer capture values, the SmaRTClock period can be determined with respect to the system clock divided by 12. The system clock divided by 12 should be much faster than the SmaRTClock to achieve an accurate reading. For example, if T1XCLK = 0b, and TF1CEN = 1b, Timer 1 will increment every 12 system clock cycles and capture every 8 SmaRTClock cycles. If the system clock is 24.5 MHz and the SmaRTClock is 32.768 kHz, the difference between two successive captures should be approximately 498 counts. Knowing the system clock frequency, the SmaRTClock frequency can be estimated as: (SYSCLK x 8 / 12) / Counts = (24500000 Hz x 8 / 12) / 498 = 16333333 / 498 = 32797 Hz. This mode allows software to determine the SmaRTClock oscillator frequency when the SmaRTClock oscillator is being used in self-oscillate mode without a crystal.
TR1
TCLK
SYSCLK / 12 Capture
TMR1L
TMR1H
TF1CEN
TMR1RLL TMR1RLH
Interrupt
SmaRTClock / 8
Figure 13.3. Timer 1 Capture Mode Block Diagram
Rev. 1.0
97
CP2400/1/2/3
SFR Definition 13.6. TMR1CN: Timer 1 Control
Bit Name Type Reset R/W 0 R/W 0 7 6 5 TF1LEN R/W 0 4 TF1CEN R/W 0 R/W 0 3 2 TR1 R/W 0 R/W 0 R/W 0 1 0
SFR Address = 0x59 Bit Name 7:6 5 Unused TF1LEN Read = 00b. Write = Don't Care. Timer 1 Low Byte Interrupt Enable.
Function
When set to 1, this bit enables Timer 1 Low Byte interrupts. If Timer 1 interrupts are enabled, an interrupt will be generated when the low byte of Timer 1 overflows. 4 3 2 1 0 TF1CEN Unused TR1 Unused T1XCLK Timer 1 SmaRTClock Oscillator Capture Enable. When set to 1, this bit enables the Timer 1 SmaRTClock Oscillator capture mode. Read = 00b. Write = Don't Care. Timer 1 Run Control. Timer 1 is enabled by setting this bit to 1. Read = 0b. Write = Don't Care. Timer 1 External Clock Select. 0: Timer 1 is clocked from the system clock divided by 12. 1: Timer 1 is clocked from the SmaRTClock oscillator divided by 8.
98
Rev. 1.0
CP2400/1/2/3
SFR Definition 13.7. TMR1RLL: Timer 1 Reload Register Low Byte
Bit Name Type Reset 0 0 0 0 7 6 5 4 3 2 1 0
TMR1RLL[7:0] R/W 0 0 0 0
SFR Address = 0x55 Bit Name 7:0 TMR1RLL[7:0] Timer 1 Reload Register Low Byte.
Function TMR1RLL holds the low byte of the reload value for Timer 1.
SFR Definition 13.8. TMR1RLH: Timer 1 Reload Register High Byte
Bit Name Type Reset 0 0 0 0 7 6 5 4 3 2 1 0
TMR1RLH[7:0] R/W 0 0 0 0
SFR Address = 0x56 Bit Name 7:0 TMR1RLH[7:0] Timer 1 Reload Register High Byte.
Function TMR1RLH holds the high byte of the reload value for Timer 1.
Rev. 1.0
99
CP2400/1/2/3
SFR Definition 13.9. TMR1L: Timer 1 Low Byte
Bit Name Type Reset 0 0 0 0 7 6 5 4 TMR1L[7:0] R/W 0 0 0 0 3 2 1 0
SFR Address = 0x57 Bit Name 7:0 TMR1L[7:0] Timer 1 Low Byte.
Function
Contains the low byte of the 16-bit Timer 1.
SFR Definition 13.10. TMR1H Timer 1 High Byte
Bit Name Type Reset 0 0 0 0 7 6 5 4 3 2 1 0
TMR1H[7:0] R/W 0 0 0 0
SFR Address = 0x58 Bit Name 7:0 TMR1H[7:0] Timer 1 High Byte.
Function
Contains the high byte of the 16-bit Timer 1.
100
Rev. 1.0
CP2400/1/2/3
14. Serial Peripheral Interface (SPI)
CP2400/2 devices have a 4-wire Serial Peripheral Interface which provides access to the internal registers and memory. A typical connection to a SPI master is shown in Figure 14.1.
GPIO
INT MISO MOSI SCK NSS
Master Device
GPIO GPIO
MISO MOSI SCK NSS
Slave Device
INT MISO MOSI SCK NSS
Slave Device
Figure 14.1. SPI Connection Diagram
14.1. Signal Descriptions
The four signals used by the SPI (MOSI, MISO, SCK, NSS) are described below.
14.1.1. Master Out, Slave In (MOSI)
The master-out, slave-in (MOSI) signal is an output from a master device and an input to slave devices. It is used to serially transfer data from the master to the slave. This signal is always in input for CP2402/1 devices. Data is transferred most-significant bit first.
14.1.2. Master In, Slave Out (MISO)
The master-in, slave-out (MISO) signal is an output from a slave device and an input to the master device. It is used to serially transfer data from the slave to the master. This signal is always an output for CP2402/1 devices. Data is transferred most-significant bit first. The MISO pin is placed in a high-impedance state when the slave select (NSS) signal is de-asserted.
14.1.3. Serial Clock (SCK)
The serial clock (SCK) signal is an output from the master device and an input to slave devices. It is used to synchronize the transfer of data between the master and slave on the MOSI and MISO lines. This signal is always an input for CP2402/1 devices. The SCK signal is ignored when the slave select (NSS) signal is de-asserted.
14.1.4. Slave Select (NSS)
The active-low slave-select (NSS) signal allows support for multiple slave devices on a single bus. It is also used by the CP2402/1 to detect the start and end of a SPI transfer.
Rev. 1.0
101
CP2400/1/2/3
14.2. Serial Clock Timing
The clock to data relationship is shown in Figure 14.2. If the SPI master is a C8051 microcontroller, its SPI peripheral must be configured for Mode 0 communication (CKPOL = 0, CKPHA = 0). The maximum data transfer rate (bits/sec) for full-duplex operation is 1/10 the system clock frequency, provided that the master issues SCK, NSS, and the serial input data synchronously with the system clock. If the master issues SCK, NSS, and the serial input data asynchronously, the maximum data transfer rate (bits/sec) must be less than 1/10 the system clock frequency. In the special case where the master only wants to transmit data to the device and does not need to receive data back (i.e. half-duplex operation), the slave can receive data at a maximum data transfer rate (bits/sec) of 1/4 the system clock frequency. This is provided that the master issues SCK, NSS, and the serial input data synchronously with the system clock.
SCK (CKPOL=0, CKPHA=0)
MOSI
MSB
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
MISO
MSB
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
NSS (4-Wire Mode)
Figure 14.2. Data/Clock Timing
102
Rev. 1.0
CP2400/1/2/3
Table 14.1. SPI Slave Timing Parameters
Parameter TSE TSD TSEZ TSDZ TCKH TCKL TSIS TSIH TSOH TSLH Description NSS Falling to First SCK Edge Last SCK Edge to NSS Rising NSS Falling to MISO Valid NSS Rising to MISO High-Z SCK High Time SCK Low Time MOSI Valid to SCK Sample Edge SCK Sample Edge to MOSI Change SCK Shift Edge to MISO Change Last SCK Edge to MISO Change (CKPHA = 1 ONLY) Min 2 x TSYSCLK 2 x TSYSCLK -- -- 5 x TSYSCLK 5 x TSYSCLK 2 x TSYSCLK 2 x TSYSCLK -- 6 x TSYSCLK Max -- -- 4 x TSYSCLK 4 x TSYSCLK -- -- -- -- 4 x TSYSCLK 8 x TSYSCLK Units ns ns ns ns ns ns ns ns ns ns
Note: TSYSCLK is equal to one period of the device system clock (SYSCLK).
NSS T T T
SE
CKL
SD
SCK* T
CKH
T
SIS
T
SIH
MOSI
T
SEZ
T
SOH
T
SDZ
MISO
Figure 14.3. SPI Slave Timing
Rev. 1.0
103
CP2400/1/2/3
15. SMBus Interface
The SMBus I/O interface is a two-wire, bi-directional serial bus that can be used to access the internal registers and memory on CP2401/3 devices. The SMBus is compliant with the System Management Bus Specification, version 1.1, and compatible with the I2C serial bus. Reads and writes to the interface by the system controller are byte oriented with the SMBus interface autonomously controlling the serial transfer of the data. Data can be transferred at up to 1/20th of the system clock (this can be faster than allowed by the SMBus specification, depending on the system clock used). A method of extending the clock-low duration is available to accommodate devices with different speed capabilities on the same bus.
15.1. Supporting Documents
It is assumed the reader is familiar with or has access to the following supporting documents: 1. The I2C-Bus and How to Use It (including specifications), Philips Semiconductor. 2. The I2C-Bus Specification--Version 2.0, Philips Semiconductor. 3. System Management Bus Specification--Version 1.1, SBS Implementers Forum.
15.2. SMBus Configuration
Figure 15.1 shows a typical SMBus configuration. The SMBus specification allows any recessive voltage between 3.0 V and 5.0 V; different devices on the bus may operate at different voltage levels. The bi-directional SCL (serial clock) and SDA (serial data) lines must be connected to a positive power supply voltage through a pullup resistor or similar circuit. Every device connected to the bus must have an open-drain or open-collector output for both the SCL and SDA lines, so that both are pulled high (recessive state) when the bus is free. The maximum number of devices on the bus is limited only by the requirement that the rise and fall times on the bus not exceed 300 ns and 1000 ns, respectively.
VDD = 5 V
VDD = 3 V
VDD = 5 V
VDD = 3 V
Master Device
Slave Device 1
Slave Device 2
SDA SCL
Figure 15.1. Typical SMBus Configuration
104
Rev. 1.0
CP2400/1/2/3
15.3. SMBus Operation
Two types of data transfers are possible: data transfers from a master transmitter to an addressed slave receiver (WRITE), and data transfers from an addressed slave transmitter to a master receiver (READ). The master device initiates both types of data transfers and provides the serial clock pulses on SCL. The SMBus interface on CP2401/ 3 devices only supports slave receiver and slave transmitter modes. A typical SMBus transaction consists of a START condition followed by an address byte (Bits7-1: 7-bit slave address; Bit0: R/W direction bit), one or more bytes of data, and a STOP condition. Bytes that are received (by a master or slave) are acknowledged (ACK) with a low SDA during a high SCL (see Figure 15.2). If the receiving device does not ACK, the transmitting device will read a NACK (not acknowledge), which is a high SDA during a high SCL. The direction bit (R/W) occupies the least-significant bit position of the address byte. The direction bit is set to logic 1 to indicate a "READ" operation and cleared to logic 0 to indicate a "WRITE" operation. All transactions are initiated by a master, with one or more addressed slave devices as the target. The master generates the START condition and then transmits the slave address and direction bit. If the transaction is a WRITE operation from the master to the slave, the master transmits the data a byte at a time waiting for an ACK from the slave at the end of each byte. For READ operations, the slave transmits the data waiting for an ACK from the master at the end of each byte. At the end of the data transfer, the master generates a STOP condition to terminate the transaction and free the bus. Figure 15.2 illustrates a typical SMBus transaction.
SCL
SDA SLA6 SLA5-0 R/W D7 D6-0
START
Slave Address + R/W
ACK
Data Byte
NACK
STOP
Figure 15.2. SMBus Transaction 15.3.1. Transmitter Vs. Receiver
On the SMBus communications interface, a device is the "transmitter" when it is sending an address or data byte to another device on the bus. A device is a "receiver" when an address or data byte is being sent to it from another device on the bus. The transmitter controls the SDA line during the address or data byte. After each byte of address or data information is sent by the transmitter, the receiver sends an ACK or NACK bit during the ACK phase of the transfer, during which time the receiver controls the SDA line.
15.3.2. Clock Low Extension
SMBus provides a clock synchronization mechanism, similar to I2C, which allows devices with different speed capabilities to coexist on the bus. A clock-low extension is used during a transfer in order to allow slower slave devices to communicate with faster masters. The slave may temporarily hold the SCL line LOW to extend the clock low period, effectively decreasing the serial clock frequency.
Rev. 1.0
105
CP2400/1/2/3
15.3.3. SCL Low Timeout
If the SCL line is held low by a slave device on the bus, no further communication is possible. Furthermore, the master cannot force the SCL line high to correct the error condition. To solve this problem, the SMBus protocol specifies that devices participating in a transfer must detect any clock cycle held low longer than 25 ms as a "timeout" condition. Devices that have detected the timeout condition must reset the communication no later than 10 ms after detecting the timeout condition. When SMBus is used for communication with the host microcontroller, Timer 0 is used to detect SCL low timeouts. Timer 0 is forced to reload when SCL is high, and allowed to count when SCL is low. With Timer 0 enabled and configured to overflow after 25 ms, the Timer 0 interrupt service routine can be used to alert the host microcontroller of an SCL Low Timeout. After an SCL Low Timeout, the SMBus slave will reset its internal state machine and will be ready to respond to new transfers. On reset or wake-up from ULP mode, Timer 0 is enabled and configured for SCL Low Timeout detection. The SCL Low Timeout may be disabled by clearing the SMBTOE bit in the SMB0CF register. This allows full software control of Timer 0.
15.3.4. SCL High (SMBus Free) Timeout
The SMBus specification stipulates that if the SCL and SDA lines remain high for more that 50 s, the bus is designated as free. When the SMBFTE bit in SMB0CF is set, the bus will be considered free if SCL and SDA remain high for more than 1250 system clock periods. After an SCL High Timeout, the SMBus slave will reset its internal state machine and will be ready to respond to new transfers.
15.3.5. Slave Address Selection
CP2400/1/2/3 devices can have one of 2 possible 7-bit, left-justified slave addresses: 0x74 and 0x76. The least significant bit of the slave address is set by the SMBA0 pin. The remaining bits in the slave address are fixed. The bit following the least significant address bit is used to indicate whether the current transfer is a read or a write.
106
Rev. 1.0
CP2400/1/2/3
SFR Definition 15.1. SMBCF: SMBus Clock/Configuration
Bit Name Type Reset (CP2400/2) Reset (CP2401/3) Address: 0x68 Bit Name SMBus Enable. 7 ENSMB This bit enables the SMBus interface when set to 1. When enabled, the interface constantly monitors the SDA and SCL pins. SMBus Slave Inhibit. 6 INH When this bit is set to logic 1, the SMBus does not generate an interrupt when slave events occur. This effectively removes the SMBus slave from the bus. SMBus Busy Indicator. 5 BUSY This bit is set to logic 1 by hardware when a transfer is in progress. It is cleared to logic 0 when a STOP or free-timeout is sensed. SMBus Setup and Hold Time Extension Enable. 4 EXTHOLD This bit controls the SDA setup and hold times. 0: Setup time is 4 system clocks and hold time is 3 system clocks. 1: Setup time is 11 system clocks and hold time is 12 system clocks. SMBus SCL Timeout Detection Enable. 3 SMBTOE This bit enables SCL low timeout detection. If set to logic 1, the SMBus forces Timer 0 to reload while SCL is high and allows Timer 0 to count when SCL goes low. The Timer 0 reload value should be set to overflow the timer after 25 ms. SMBus Free Timeout Detection Enable. 2 1:0 SMBFTE Reserved When this bit is set to logic 1, the bus will be considered free if SCL and SDA remain high for more than 50 s. Read = 00b. Must write 00b. 7 ENSMB R/W 0 1 6 INH R/W 0 0 5 BUSY R 0 0 4 3 2 SMBFTE R/W 0 1 0 0 1 Reserved R/W 0 0 0
EXTHOLD SMBTOE R/W 0 1 R/W 0 1
Function
Note: This register has a reset value of 0x00 in devices that do not support SMBus.
Rev. 1.0
107
CP2400/1/2/3
DOCUMENT CHANGE LIST
Revision 0.2 to Revision 1.0

Updated Electrical Specifications to remove TBDs and specify min/max parameters. Updated Reset Values for various registers. Updated Register Description for LCD0PWR register.
108
Rev. 1.0
CP2400/1/2/3
NOTES:
Rev. 1.0
109
CP2400/1/2/3
CONTACT INFORMATION
Silicon Laboratories Inc.
400 West Cesar Chavez Austin, TX 78701 Please visit the Silicon Labs Technical Support web page: https://www.silabs.com/support/pages/contacttechnicalsupport.aspx and register to submit a technical support request.
The information in this document is believed to be accurate in all respects at the time of publication but is subject to change without notice. Silicon Laboratories assumes no responsibility for errors and omissions, and disclaims responsibility for any consequences resulting from the use of information included herein. Additionally, Silicon Laboratories assumes no responsibility for the functioning of undescribed features or parameters. Silicon Laboratories reserves the right to make changes without further notice. Silicon Laboratories makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Silicon Laboratories assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Silicon Laboratories products are not designed, intended, or authorized for use in applications intended to support or sustain life, or for any other application in which the failure of the Silicon Laboratories product could create a situation where personal injury or death may occur. Should Buyer purchase or use Silicon Laboratories products for any such unintended or unauthorized application, Buyer shall indemnify and hold Silicon Laboratories harmless against all claims and damages. Silicon Laboratories, Silicon Labs, and USBXpress are trademarks of Silicon Laboratories Inc. Intel, Motorola, and any other products or brandnames mentioned herein are trademarks or registered trademarks of their respective holders.
110
Rev. 1.0


▲Up To Search▲   

 
Price & Availability of CP2400

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X